Skip to content

Commit ff646f7

Browse files
committed
merge lua.config request
1 parent bb8a0af commit ff646f7

File tree

2 files changed

+26
-22
lines changed

2 files changed

+26
-22
lines changed

client/out/languageserver.js

Lines changed: 13 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/src/languageserver.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,19 @@ let defaultClient: LanguageClient;
2525
let clients: Map<string, LanguageClient> = new Map();
2626

2727
function registerCustomCommands(context: ExtensionContext) {
28-
context.subscriptions.push(Commands.registerCommand('lua.config', (data) => {
29-
let config = Workspace.getConfiguration(undefined, Uri.parse(data.uri));
30-
if (data.action == 'add') {
31-
let value: any[] = config.get(data.key);
32-
value.push(data.value);
33-
config.update(data.key, value, data.global);
34-
return;
35-
}
36-
if (data.action == 'set') {
37-
config.update(data.key, data.value, data.global);
38-
return;
28+
context.subscriptions.push(Commands.registerCommand('lua.config', (changes) => {
29+
for (const data of changes) {
30+
let config = Workspace.getConfiguration(undefined, Uri.parse(data.uri));
31+
if (data.action == 'add') {
32+
let value: any[] = config.get(data.key);
33+
value.push(data.value);
34+
config.update(data.key, value, data.global);
35+
continue;
36+
}
37+
if (data.action == 'set') {
38+
config.update(data.key, data.value, data.global);
39+
continue;
40+
}
3941
}
4042
}))
4143
}

0 commit comments

Comments
 (0)