Skip to content

Commit

Permalink
chore: run prettier (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench authored Dec 11, 2023
1 parent 20eea64 commit 1b0d57e
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 34 deletions.
6 changes: 1 addition & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,5 @@
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"cSpell.words": [
"acir",
"brillig",
"nargo"
]
"cSpell.words": ["acir", "brillig", "nargo"]
}
6 changes: 4 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
ServerCapabilities,
ServerOptions,
TextDocumentFilter,

} from "vscode-languageclient/node";

import { extensionName, languageId } from "./constants";
Expand Down Expand Up @@ -201,7 +200,10 @@ export default class Client extends LanguageClient {
}

async refreshProfileInfo() {
const response = await this.sendRequest<NargoProfileRunResult>("nargo/profile/run", { package: ""});
const response = await this.sendRequest<NargoProfileRunResult>(
"nargo/profile/run",
{ package: "" }
);

this.profileRunResult = response;
}
Expand Down
47 changes: 22 additions & 25 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import { lspClients, editorLineDecorationManager } from "./noir";

let activeCommands: Map<string, Disposable> = new Map();


let activeMutex: Set<string> = new Set();

function mutex(key: string, fn: (...args: unknown[]) => Promise<void>) {
Expand Down Expand Up @@ -146,42 +145,40 @@ function registerCommands(uri: Uri) {
commands$.push(command$);
}


let profileCommand$ = commands.registerCommand(
"nargo.profile",
async (...args) => {

window.withProgress({
location: ProgressLocation.Window,
cancellable: false,
title: 'Getting Profile Information'
}, async (progress) => {

progress.report({ increment: 0 });

let workspaceFolder = workspace.getWorkspaceFolder(uri).uri.toString();
const activeClient = lspClients.get(workspaceFolder);

await activeClient.refreshProfileInfo();
editorLineDecorationManager.displayAllTextDecorations();

progress.report({ increment: 100 });
});

async (...args) => {
window.withProgress(
{
location: ProgressLocation.Window,
cancellable: false,
title: "Getting Profile Information",
},
async (progress) => {
progress.report({ increment: 0 });

let workspaceFolder = workspace
.getWorkspaceFolder(uri)
.uri.toString();
const activeClient = lspClients.get(workspaceFolder);

await activeClient.refreshProfileInfo();
editorLineDecorationManager.displayAllTextDecorations();

progress.report({ increment: 100 });
}
);
}
);
commands$.push(profileCommand$);
let hideProfileInformationCommand$ = commands.registerCommand(
"nargo.profile.hide",
async (...args) => {

async (...args) => {
editorLineDecorationManager.hideDecorations();

}
);
commands$.push(hideProfileInformationCommand$);


activeCommands.set(file, Disposable.from(...commands$));
}

Expand Down
4 changes: 3 additions & 1 deletion src/noir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ import Client from "./client";

export let lspClients: Map<string, Client> = new Map();

export const editorLineDecorationManager = new EditorLineDecorationManager(lspClients);
export const editorLineDecorationManager = new EditorLineDecorationManager(
lspClients
);
2 changes: 1 addition & 1 deletion syntaxes/noir.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -324,4 +324,4 @@
}
},
"scopeName": "source.nr"
}
}

0 comments on commit 1b0d57e

Please sign in to comment.