check if buffer is handled

This commit is contained in:
chemzqm 2019-06-26 12:33:39 +08:00
parent 7c351af28f
commit 74bd823e4e
2 changed files with 5 additions and 0 deletions

View file

@ -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()

View file

@ -65,6 +65,7 @@ export default class FileConfigurationManager {
public async ensureConfigurationForDocument(document: TextDocument): Promise<void> {
let opts = await workspace.getFormatOptions(document.uri)
if (!this.client.bufferSyncSupport.has(document.uri)) return
return this.ensureConfigurationOptions(document.languageId, opts.insertSpaces, opts.tabSize)
}