Pārlūkot izejas kodu

Avoids adding settings for defaults

main
Eric Amodio pirms 6 gadiem
vecāks
revīzija
4bd4e71704
1 mainītis faili ar 7 papildinājumiem un 1 dzēšanām
  1. +7
    -1
      src/pageProvider.ts

+ 7
- 1
src/pageProvider.ts Parādīt failu

@ -52,7 +52,13 @@ export class PageProvider extends Disposable implements TextDocumentContentProvi
Logger.log(`PageProvider.save: changes=${JSON.stringify(changes)}`);
for (const key in changes) {
await configuration.update(key, changes[key], ConfigurationTarget.Global);
const inspect = await configuration.inspect(key)!;
if (inspect.defaultValue === changes[key]) {
await configuration.update(key, undefined, ConfigurationTarget.Global);
}
else {
await configuration.update(key, changes[key], ConfigurationTarget.Global);
}
}
}

Notiek ielāde…
Atcelt
Saglabāt