From 55a10f77e8e2fa5ba816366f6928131a02a6992a Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 30 Apr 2018 18:18:05 -0700 Subject: [PATCH] Don't try creating a new synced buffer if we already have one Possibly https://github.com/Microsoft/TypeScript/issues/23502 --- .../src/features/bufferSyncSupport.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/extensions/typescript-language-features/src/features/bufferSyncSupport.ts b/extensions/typescript-language-features/src/features/bufferSyncSupport.ts index 105663f14e4..bdd33e3a7c9 100644 --- a/extensions/typescript-language-features/src/features/bufferSyncSupport.ts +++ b/extensions/typescript-language-features/src/features/bufferSyncSupport.ts @@ -206,6 +206,11 @@ export default class BufferSyncSupport { if (!filepath) { return; } + + if (this.syncedBuffers.has(resource)) { + return; + } + const syncedBuffer = new SyncedBuffer(document, filepath, this, this.client); this.syncedBuffers.set(resource, syncedBuffer); syncedBuffer.open();