Skip to content

Commit ee7c340

Browse files
stamblerresuzmue
authored andcommitted
goLanguageServer: print out all GOPATHs when there are multiple
Updates #1848 Change-Id: I482625276bd4dd8adefea90c0ae595c77abae48c Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/356909 Trust: Rebecca Stambler <[email protected]> Run-TryBot: Rebecca Stambler <[email protected]> Reviewed-by: Suzy Mueller <[email protected]>
1 parent 656865d commit ee7c340

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/goLanguageServer.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ export function getLanguageServerToolPath(): string {
10231023
// Check that all workspace folders are configured with the same GOPATH.
10241024
if (!allFoldersHaveSameGopath()) {
10251025
vscode.window.showInformationMessage(
1026-
'The Go language server is currently not supported in a multi-root set-up with different GOPATHs.'
1026+
`The Go language server is currently not supported in a multi-root set-up with different GOPATHs (${gopathsPerFolder()}).`
10271027
);
10281028
return;
10291029
}
@@ -1057,6 +1057,14 @@ function allFoldersHaveSameGopath(): boolean {
10571057
return vscode.workspace.workspaceFolders.find((x) => tempGopath !== getCurrentGoPath(x.uri)) ? false : true;
10581058
}
10591059

1060+
function gopathsPerFolder(): string[] {
1061+
const result: string[] = [];
1062+
for (const folder of vscode.workspace.workspaceFolders) {
1063+
result.push(getCurrentGoPath(folder.uri));
1064+
}
1065+
return result;
1066+
}
1067+
10601068
export async function shouldUpdateLanguageServer(
10611069
tool: Tool,
10621070
cfg: LanguageServerConfig,

0 commit comments

Comments
 (0)