Skip to content

Commit e27f716

Browse files
committed
Restrict to desktop
1 parent b9bd53d commit e27f716

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

src/extension-node.ts

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,34 @@ export function activate(context: vscode.ExtensionContext): void {
3333
commandRegistrar.register('citeWeb', addWebCiteFactory);
3434

3535
configureLuaLibrary(
36-
"Scribunto",
37-
vscode.workspace.getConfiguration("wikitext").get<string>("scopedLuaIntegration") !== "disabled"
36+
'Scribunto',
37+
vscode.workspace.getConfiguration('wikitext').get<string>('scopedLuaIntegration') !== 'disabled'
3838
);
3939
}
4040

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

44-
if (vscode.workspace.getConfiguration("wikitext").get<string>("scopedLuaIntegration") !== "enabled") {
45-
configureLuaLibrary("Scribunto", false);
44+
if (vscode.workspace.getConfiguration('wikitext').get<string>('scopedLuaIntegration') !== 'enabled') {
45+
configureLuaLibrary('Scribunto', false);
4646
}
4747
}
4848

4949
export function configureLuaLibrary(folder: string, enable: boolean) {
50-
const extensionId = "rowewilsonfrederiskholme.wikitext";
50+
// https://github.com/LuaLS/lua-language-server/issues/1689
51+
if (vscode.env.uiKind !== vscode.UIKind.Desktop) {
52+
return;
53+
}
54+
55+
const extensionId = 'rowewilsonfrederiskholme.wikitext';
5156
const extensionPath = vscode.extensions.getExtension(extensionId)?.extensionPath;
5257
if (extensionPath === undefined) {
5358
return;
5459
}
5560

56-
const folderPath = path.join(extensionPath, "EmmyLua", folder);
57-
const config = vscode.workspace.getConfiguration("Lua");
58-
let library: string[] | undefined = config.get("workspace.library");
61+
const folderPath = path.join(extensionPath, 'EmmyLua', folder);
62+
const config = vscode.workspace.getConfiguration('Lua');
63+
let library: string[] | undefined = config.get('workspace.library');
5964
if (library === undefined) {
6065
return;
6166
}
@@ -75,6 +80,6 @@ export function configureLuaLibrary(folder: string, enable: boolean) {
7580
else if (index >= 0) {
7681
library.splice(index, 1);
7782
}
78-
config.update("workspace.library", library, false);
83+
config.update('workspace.library', library, false);
7984
}
8085
}

0 commit comments

Comments
 (0)