File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -72,11 +72,23 @@ export default () => {
7272const isConfigValueChanged = ( settingId : string ) => {
7373 if ( process . env . PLATFORM !== 'web' ) {
7474 const config = vscode . workspace . getConfiguration ( '' )
75- const userValue = config . get < string > ( settingId )
76- if ( userValue === config . inspect ( settingId ) ! . defaultValue ) return false
75+ let userValue = config . get < string > ( settingId )
76+ if ( ! userValue || userValue === config . inspect ( settingId ) ! . defaultValue ) return false
7777 // means that value was set by us programmatically, let's update it
7878 // eslint-disable-next-line @typescript-eslint/no-require-imports
79- if ( userValue ?. startsWith ( require ( 'path' ) . join ( extensionCtx . extensionPath , '../..' ) ) ) return false
79+ let extensionsBasePath = require ( 'path' ) . join ( extensionCtx . extensionPath , '../..' ) as string
80+ const normalizePathWin = ( path : string ) => {
81+ // normalize casing of drive
82+ if ( / ^ [ a - z ] : / . test ( path ) ) {
83+ path = path [ 0 ] ! . toUpperCase ( ) + path . slice ( 1 )
84+ }
85+
86+ return path . replace ( / \\ / g, '/' )
87+ }
88+
89+ userValue = normalizePathWin ( userValue )
90+ extensionsBasePath = normalizePathWin ( extensionsBasePath )
91+ if ( userValue . startsWith ( extensionsBasePath ) ) return false
8092 return true
8193 }
8294
You can’t perform that action at this time.
0 commit comments