From 6ffcd1a358c2113b36f5e47c491c1ee286bead8f 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 dc435fe7..c9c43606 100644 --- a/toolchains/solidity/extension/src/extension.ts +++ b/toolchains/solidity/extension/src/extension.ts @@ -5,6 +5,7 @@ import { import { createLinterClient } from './linter'; import { createFoundryCompilerClient } from './foundry-compiler'; import { createSlitherClient } from './slither'; +import registerForgeFmtLinter from "./fmt-wrapper"; let slitherClient: LanguageClient; let linterClient: LanguageClient; @@ -19,13 +20,16 @@ export async function activate(context: ExtensionContext) { context.subscriptions.push(foundryCompilerClient); context.subscriptions.push(slitherClient); + 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;