Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Commit

Permalink
refactor(solidity/extension) : renamed variable to make it clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmemorygrinder committed Jan 9, 2024
1 parent 5205de8 commit e561c5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion toolchains/solidity/extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
});
}

Expand Down
4 changes: 2 additions & 2 deletions toolchains/solidity/extension/src/fmt-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function registerForgeFmtLinter(context: vscode.ExtensionContext) {
}
);

const linter = vscode.languages.registerDocumentFormattingEditProvider(
const formatter = vscode.languages.registerDocumentFormattingEditProvider(
"solidity",
{
provideDocumentFormattingEdits: (document) => {
Expand Down Expand Up @@ -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;

0 comments on commit e561c5f

Please sign in to comment.