Skip to content

Commit 1812139

Browse files
committed
src/goLanguageServer: disable language service on guest side completely
The language client library sends workspace folder with vsls uri scheme which makes gopls unhappy. According to LiveShare guideline https://docs.microsoft.com/en-us/visualstudio/liveshare/reference/extensions#visual-studio-code-1 "Guests receive the language service results from both their local extensions, and the host, and therefore, if both participants have the same language service extension installed, guests will see duplicate entries for certain things (e.g. auto-completion, code actions)" That implies the language service on the guest side is unnecessary. Actually, excluding all the go files, there is no reason to start the language server at all. Manually tested. Fixes #605 Fixes #1024 Change-Id: Ib9e72fe848a202c9e3cc9aa4d183a2919cf07797 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/277392 Reviewed-by: Rebecca Stambler <rstambler@golang.org> Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: kokoro <noreply+kokoro@google.com>
1 parent a1ed38c commit 1812139

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/goLanguageServer.ts

+9
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,15 @@ let lastUserAction: Date = new Date();
108108
// startLanguageServerWithFallback starts the language server, if enabled,
109109
// or falls back to the default language providers.
110110
export async function startLanguageServerWithFallback(ctx: vscode.ExtensionContext, activation: boolean) {
111+
112+
for (const folder of vscode.workspace.workspaceFolders || []) {
113+
if (folder.uri.scheme === 'vsls') {
114+
outputChannel.appendLine(`Language service on the guest side is disabled. ` +
115+
`The server-side language service will provide the language features.`);
116+
return;
117+
}
118+
}
119+
111120
if (!activation && languageServerStartInProgress) {
112121
console.log('language server restart is already in progress...');
113122
return;

0 commit comments

Comments
 (0)