From 6553bab5701e4fdd46adb920dcd89f5c95e6b2e2 Mon Sep 17 00:00:00 2001 From: yioneko Date: Mon, 30 Dec 2024 22:56:25 +0800 Subject: [PATCH] fix: do not ask client to open file from server to resolve #199 --- .../patches/310-fix-randomly-open-file.patch | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 packages/service/patches/310-fix-randomly-open-file.patch diff --git a/packages/service/patches/310-fix-randomly-open-file.patch b/packages/service/patches/310-fix-randomly-open-file.patch new file mode 100644 index 0000000..d3522c7 --- /dev/null +++ b/packages/service/patches/310-fix-randomly-open-file.patch @@ -0,0 +1,17 @@ +diff --git a/src/typeScriptServiceClientHost.ts b/src/typeScriptServiceClientHost.ts +index 0268e5f..b58be99 100644 +--- a/src/typeScriptServiceClientHost.ts ++++ b/src/typeScriptServiceClientHost.ts +@@ -206,12 +206,6 @@ export default class TypeScriptServiceClientHost extends Disposable { + return language; + } + } +- +- // If that doesn't work, fallback to using a text document language mode. +- // This is not ideal since we have to open the document but should always +- // be correct +- const doc = await vscode.workspace.openTextDocument(resource); +- return this.languages.find(language => language.handlesDocument(doc)); + } catch { + return undefined; + }