@@ -16,6 +16,9 @@ import { ToolkitError } from './errors'
16
16
17
17
type Workspace = Pick < typeof vscode . workspace , 'getConfiguration' | 'onDidChangeConfiguration' >
18
18
19
+ /** Used by isValid(). Must be something that's defined in our package.json. */
20
+ const testSetting = 'aws.samcli.lambdaTimeout'
21
+
19
22
/**
20
23
* A class for manipulating VS Code user settings (from all extensions).
21
24
*
@@ -93,7 +96,7 @@ export class Settings {
93
96
* "recoverable" JSON syntax errors.
94
97
*/
95
98
public async isValid ( ) : Promise < 'ok' | 'invalid' | 'nowrite' > {
96
- const key = 'aws.samcli.lambdaTimeout'
99
+ const key = testSetting
97
100
const config = this . getConfig ( )
98
101
const tempValOld = 1234 // Legacy temp value we are migrating from.
99
102
const tempVal = 91234 // Temp value used to check that read/write works.
@@ -122,7 +125,7 @@ export class Settings {
122
125
return 'nowrite'
123
126
}
124
127
125
- const logMsg = 'settings: invalid " settings.json" : %s'
128
+ const logMsg = 'settings: invalid settings.json: %s'
126
129
getLogger ( ) . error ( logMsg , err . message )
127
130
128
131
return 'invalid'
@@ -386,7 +389,9 @@ function createSettingsClass<T extends TypeDescriptor>(section: string, descript
386
389
}
387
390
388
391
for ( const key of props . filter ( isDifferent ) ) {
389
- this . log ( 'key "%s" changed' , key )
392
+ if ( `${ section } .${ key } ` !== testSetting ) {
393
+ this . log ( 'key "%s" changed' , key )
394
+ }
390
395
emitter . fire ( { key } )
391
396
}
392
397
} )
0 commit comments