Skip to content

Commit 4423833

Browse files
committed
fix(settings): "accessing configuration without providing a resource"
Problem: vscode extension host logs show many warnings like this: [warning] [amazonwebservices.aws-toolkit-vscode] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for 'files.watcherExclude', provide the URI of a resource or 'null' for any resource Solution: Default to `null` instead of `undefined` when getting a config.
1 parent d3549a1 commit 4423833

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/shared/settings.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ export class Settings {
151151
* The resulting configuration object should not be cached.
152152
*/
153153
private getConfig(section?: string) {
154-
return this.workspace.getConfiguration(section, this.scope)
154+
// eslint-disable-next-line no-null/no-null
155+
return this.workspace.getConfiguration(section, this.scope ?? null)
155156
}
156157

157158
/**
@@ -167,7 +168,7 @@ export class Settings {
167168
static #instance: Settings
168169

169170
/**
170-
* A singleton scoped to the global configuration target.
171+
* A singleton scoped to the global configuration target and `null` resource.
171172
*/
172173
public static get instance() {
173174
return (this.#instance ??= new this())

0 commit comments

Comments
 (0)