From e561c5feccb3065c8ba0ca72d221332ca9587e13 Mon Sep 17 00:00:00 2001 From: 0xMemoryGrinder <35138272+0xMemoryGrinder@users.noreply.github.com> Date: Tue, 9 Jan 2024 15:09:52 -0500 Subject: [PATCH] refactor(solidity/extension) : renamed variable to make it clearer --- toolchains/solidity/extension/src/extension.ts | 6 +++++- toolchains/solidity/extension/src/fmt-wrapper.ts | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/toolchains/solidity/extension/src/extension.ts b/toolchains/solidity/extension/src/extension.ts index e2bb06f0..1b375188 100644 --- a/toolchains/solidity/extension/src/extension.ts +++ b/toolchains/solidity/extension/src/extension.ts @@ -6,6 +6,7 @@ import { } from 'vscode-languageclient/node'; import { createLinterClient } from './linter'; import { createFoundryCompilerClient } from './foundry-compiler'; +import registerForgeFmtLinter from "./fmt-wrapper"; let linterClient: LanguageClient; let foundryCompilerClient: LanguageClient; @@ -17,13 +18,16 @@ export async function activate(context: ExtensionContext) { context.subscriptions.push(linterClient); context.subscriptions.push(foundryCompilerClient); + registerForgeFmtLinter(context); + const folders = workspace.workspaceFolders; if (folders) { const files = await workspace.findFiles('**/*.sol', `${folders[0].uri.fsPath}/**`); files.forEach(file => { - if (!file.path.includes('forge-std')) + if (!file.path.includes('forge-std')) { workspace.openTextDocument(file); + } }); } diff --git a/toolchains/solidity/extension/src/fmt-wrapper.ts b/toolchains/solidity/extension/src/fmt-wrapper.ts index 2a629992..08549f6c 100644 --- a/toolchains/solidity/extension/src/fmt-wrapper.ts +++ b/toolchains/solidity/extension/src/fmt-wrapper.ts @@ -197,7 +197,7 @@ function registerForgeFmtLinter(context: vscode.ExtensionContext) { } ); - const linter = vscode.languages.registerDocumentFormattingEditProvider( + const formatter = vscode.languages.registerDocumentFormattingEditProvider( "solidity", { provideDocumentFormattingEdits: (document) => { @@ -239,7 +239,7 @@ function registerForgeFmtLinter(context: vscode.ExtensionContext) { context.subscriptions.push(lintSolFile); context.subscriptions.push(lintSolWorkspace); - context.subscriptions.push(linter); + context.subscriptions.push(formatter); } export default registerForgeFmtLinter;