Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
davidxuang committed Mar 11, 2024
1 parent b9bd53d commit 92b26e4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/extension-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,29 @@ export function activate(context: vscode.ExtensionContext): void {
commandRegistrar.register('citeWeb', addWebCiteFactory);

configureLuaLibrary(
"Scribunto",
vscode.workspace.getConfiguration("wikitext").get<string>("scopedLuaIntegration") !== "disabled"
'Scribunto',
vscode.workspace.getConfiguration('wikitext').get<string>('scopedLuaIntegration') !== 'disabled'
);
}

export function deactivate(): void {
console.log("Extension is inactive.");

if (vscode.workspace.getConfiguration("wikitext").get<string>("scopedLuaIntegration") !== "enabled") {
configureLuaLibrary("Scribunto", false);
if (vscode.workspace.getConfiguration('wikitext').get<string>('scopedLuaIntegration') !== 'enabled') {
configureLuaLibrary('Scribunto', false);
}
}

export function configureLuaLibrary(folder: string, enable: boolean) {
const extensionId = "rowewilsonfrederiskholme.wikitext";
const extensionId = 'rowewilsonfrederiskholme.wikitext';
const extensionPath = vscode.extensions.getExtension(extensionId)?.extensionPath;
if (extensionPath === undefined) {
return;
}

const folderPath = path.join(extensionPath, "EmmyLua", folder);
const config = vscode.workspace.getConfiguration("Lua");
let library: string[] | undefined = config.get("workspace.library");
const folderPath = path.join(extensionPath, 'EmmyLua', folder);
const config = vscode.workspace.getConfiguration('Lua');
let library: string[] | undefined = config.get('workspace.library');
if (library === undefined) {
return;
}
Expand All @@ -75,6 +75,6 @@ export function configureLuaLibrary(folder: string, enable: boolean) {
else if (index >= 0) {
library.splice(index, 1);
}
config.update("workspace.library", library, false);
config.update('workspace.library', library, false);
}
}

0 comments on commit 92b26e4

Please sign in to comment.