Skip to content

Commit 8460b16

Browse files
committed
Fixed loading the extension twice
1 parent a511ae3 commit 8460b16

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Change Log
22

3-
## [0.17.2] - 2024-08-15
3+
## [0.17.3] - 2024-08-15
4+
- 0.17.3: Fixed loading the extension twice when the "Activate WoW API extension" command is used
45
- 0.17.2: Fixed [#163](https://github.com/Ketho/vscode-wow-api/issues/163) non-user paths for `Lua.workspace.library`
56
- 0.17.1: Fixed `ScriptType` param-type-mismatch
67
- 0.17.0: Updated for release patch 11.0.2 (56071)
@@ -139,6 +140,7 @@ To avoid loading for Lua projects not related to World of Warcraft, all settings
139140
- PR [#123](https://github.com/Ketho/vscode-wow-api/pull/123) Make childGroups optional in AceConfig.OptionsTable
140141
- PR [#120](https://github.com/Ketho/vscode-wow-api/pull/120) Add definition for tostringall()
141142

143+
[0.17.3]: https://github.com/Ketho/vscode-wow-api/releases/tag/0.17.3
142144
[0.17.2]: https://github.com/Ketho/vscode-wow-api/releases/tag/0.17.2
143145
[0.17.1]: https://github.com/Ketho/vscode-wow-api/releases/tag/0.17.1
144146
[0.17.0]: https://github.com/Ketho/vscode-wow-api/releases/tag/0.17.0

src/extension.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export async function activate(context: vscode.ExtensionContext) {
88
console.log("loaded", context.extension.id);
99
registerActivationCommand(context);
1010

11-
if (isWowWorkspace() || await hasTocFile()) {
11+
if (!isLoaded && (isWowWorkspace() || await hasTocFile())) {
1212
activateWowExtension(context);
1313
}
1414
}

src/luals.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,14 @@ vscode.workspace.onDidChangeConfiguration((event: vscode.ConfigurationChangeEven
169169
const wv = (lib?.workspaceValue as string[]) ?? [];
170170
const gv = (lib?.globalValue as string[] ?? []);
171171
if (configScope === "User") {
172-
const containsCfg = wv?.filter(el => el.includes("wow-api"));
173-
const nocontainsCfg = wv?.filter(el => !el.includes("wow-api"));
172+
const containsCfg = wv.filter(el => el.includes("wow-api"));
173+
const nocontainsCfg = wv.filter(el => !el.includes("wow-api"));
174174
lua_config.update("workspace.library", gv.concat(containsCfg), vscode.ConfigurationTarget.Global);
175175
lua_config.update("workspace.library", nocontainsCfg.length>0 ? nocontainsCfg : undefined, vscode.ConfigurationTarget.Workspace);
176176
}
177177
else if (configScope === "Workspace") {
178-
const containsCfg = gv?.filter(el => el.includes("wow-api"));
179-
const nocontainsCfg = gv?.filter(el => !el.includes("wow-api"));
178+
const containsCfg = gv.filter(el => el.includes("wow-api"));
179+
const nocontainsCfg = gv.filter(el => !el.includes("wow-api"));
180180
lua_config.update("workspace.library", wv.concat(containsCfg), vscode.ConfigurationTarget.Workspace);
181181
lua_config.update("workspace.library", nocontainsCfg.length>0 ? nocontainsCfg : undefined, vscode.ConfigurationTarget.Global);
182182
}

0 commit comments

Comments
 (0)