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 () => {
72
72
const isConfigValueChanged = ( settingId : string ) => {
73
73
if ( process . env . PLATFORM !== 'web' ) {
74
74
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
77
77
// means that value was set by us programmatically, let's update it
78
78
// 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
80
92
return true
81
93
}
82
94
You can’t perform that action at this time.
0 commit comments