@@ -38,10 +38,10 @@ export class Global {
3838 static async init ( context : ExtensionContext ) {
3939 this . context = context
4040
41- context . subscriptions . push ( workspace . onDidChangeWorkspaceFolders ( e => this . updateRootPath ( ) ) )
42- context . subscriptions . push ( window . onDidChangeActiveTextEditor ( e => this . updateRootPath ( ) ) )
43- context . subscriptions . push ( workspace . onDidOpenTextDocument ( e => this . updateRootPath ( ) ) )
44- context . subscriptions . push ( workspace . onDidCloseTextDocument ( e => this . updateRootPath ( ) ) )
41+ context . subscriptions . push ( workspace . onDidChangeWorkspaceFolders ( ( ) => this . updateRootPath ( ) ) )
42+ context . subscriptions . push ( window . onDidChangeActiveTextEditor ( ( ) => this . updateRootPath ( ) ) )
43+ context . subscriptions . push ( workspace . onDidOpenTextDocument ( ( ) => this . updateRootPath ( ) ) )
44+ context . subscriptions . push ( workspace . onDidCloseTextDocument ( ( ) => this . updateRootPath ( ) ) )
4545 context . subscriptions . push ( workspace . onDidChangeConfiguration ( e => this . update ( e ) ) )
4646 await this . updateRootPath ( )
4747 }
@@ -169,7 +169,7 @@ export class Global {
169169 . flatMap ( f => [
170170 f . supportedExts ,
171171 Object . entries ( Config . parsersExtendFileExtensions )
172- . find ( ( [ k , v ] ) => v === f . id ) ?. [ 0 ] ,
172+ . find ( ( [ , v ] ) => v === f . id ) ?. [ 0 ] ,
173173 ] )
174174 . filter ( Boolean )
175175 . join ( '|' )
@@ -323,9 +323,9 @@ export class Global {
323323 const frameworks = Config . enabledFrameworks
324324 this . enabledFrameworks = getEnabledFrameworksByIds ( frameworks , this . _rootpath )
325325 }
326- const isValidProject = this . enabledFrameworks . length > 0
326+ const isValidProject = this . enabledFrameworks . length > 0 && this . enabledParsers . length > 0
327327 const hasLocalesSet = Global . localesPaths . length > 0
328- const shouldEnabled = isValidProject && hasLocalesSet
328+ const shouldEnabled = ! Config . disabled && isValidProject && hasLocalesSet
329329 this . setEnabled ( shouldEnabled )
330330
331331 if ( this . enabled ) {
@@ -335,13 +335,15 @@ export class Global {
335335 await this . initLoader ( this . _rootpath , reload )
336336 }
337337 else {
338- if ( ! isValidProject )
339- Log . info ( '⚠ Current workspace is not a valid project, extension disabled' )
340- else if ( ! hasLocalesSet )
341- Log . info ( '⚠ No locales path setting found, extension disabled' )
342-
343- if ( isValidProject && ! hasLocalesSet )
344- ConfigLocalesGuide . autoSet ( )
338+ if ( ! Config . disabled ) {
339+ if ( ! isValidProject )
340+ Log . info ( '⚠ Current workspace is not a valid project, extension disabled' )
341+ else if ( ! hasLocalesSet )
342+ Log . info ( '⚠ No locales path setting found, extension disabled' )
343+
344+ if ( isValidProject && ! hasLocalesSet )
345+ ConfigLocalesGuide . autoSet ( )
346+ }
345347
346348 this . unloadAll ( )
347349 }
0 commit comments