@@ -32,12 +32,18 @@ export function activate(context: vscode.ExtensionContext): void {
32
32
// Cite
33
33
context . subscriptions . push ( vscode . commands . registerCommand ( "wikitext.citeWeb" , addWebCite ) ) ;
34
34
35
- configureLuaLibrary ( "Scribunto" , true ) ;
35
+ configureLuaLibrary (
36
+ "Scribunto" ,
37
+ vscode . workspace . getConfiguration ( "wikitext" ) . get < string > ( "scopedLuaIntegration" ) !== "disabled"
38
+ ) ;
36
39
}
37
40
38
41
export function deactivate ( ) : void {
39
42
console . log ( "Extension is inactive." ) ;
40
- configureLuaLibrary ( "Scribunto" , false ) ;
43
+
44
+ if ( vscode . workspace . getConfiguration ( "wikitext" ) . get < string > ( "scopedLuaIntegration" ) !== "enabled" ) {
45
+ configureLuaLibrary ( "Scribunto" , false ) ;
46
+ }
41
47
}
42
48
43
49
export function configureLuaLibrary ( folder : string , enable : boolean ) {
@@ -47,7 +53,6 @@ export function configureLuaLibrary(folder: string, enable: boolean) {
47
53
return ;
48
54
}
49
55
50
- // Use path.join to ensure the proper path seperators are used.
51
56
const folderPath = path . join ( extensionPath , "EmmyLua" , folder ) ;
52
57
const config = vscode . workspace . getConfiguration ( "Lua" ) ;
53
58
const library : string [ ] | undefined = config . get ( "workspace.library" ) ;
@@ -57,7 +62,7 @@ export function configureLuaLibrary(folder: string, enable: boolean) {
57
62
58
63
if ( library && extensionPath ) {
59
64
// remove any older versions of our path
60
- for ( let i = library . length - 1 ; i >= 0 ; i -- ) {
65
+ for ( let i = library . length - 1 ; i >= 0 ; i -- ) {
61
66
const item = library [ i ] ;
62
67
const isSelfExtension = item . indexOf ( extensionId ) > - 1 ;
63
68
const isCurrentVersion = item . indexOf ( extensionPath ) > - 1 ;
@@ -77,6 +82,6 @@ export function configureLuaLibrary(folder: string, enable: boolean) {
77
82
library . splice ( index , 1 ) ;
78
83
}
79
84
}
80
- config . update ( "workspace.library" , library , true ) ;
85
+ config . update ( "workspace.library" , library , false ) ;
81
86
}
82
87
}
0 commit comments