diff --git a/src/server/features/bufferSyncSupport.ts b/src/server/features/bufferSyncSupport.ts index 789104e..326c965 100644 --- a/src/server/features/bufferSyncSupport.ts +++ b/src/server/features/bufferSyncSupport.ts @@ -280,6 +280,10 @@ export default class BufferSyncSupport { this.triggerDiagnostics() } + public has(uri: string): boolean { + return this.uris.has(uri) + } + private triggerDiagnostics(delay = 200): void { this.diagnosticDelayer.trigger(() => { this.sendPendingDiagnostics() diff --git a/src/server/features/fileConfigurationManager.ts b/src/server/features/fileConfigurationManager.ts index 5b7129d..f8e24ba 100644 --- a/src/server/features/fileConfigurationManager.ts +++ b/src/server/features/fileConfigurationManager.ts @@ -65,6 +65,7 @@ export default class FileConfigurationManager { public async ensureConfigurationForDocument(document: TextDocument): Promise { let opts = await workspace.getFormatOptions(document.uri) + if (!this.client.bufferSyncSupport.has(document.uri)) return return this.ensureConfigurationOptions(document.languageId, opts.insertSpaces, opts.tabSize) }