Failed to start vls and load document on windows
Closed this issue · 3 comments
taozuhong commented
OS: Windows7 6.1.7601 + MSYS2 (3.1.4) + Pacman(5.2.1)
Vala: 0.48
-
clone vls and compile it, then copy vala-language-server.exe to /mingw64/bin
----> vala-vscode can't load and start vls -
update client.ts to return valid path directly:
return "c:\\msys\\mingw64\\bin\\vala-language-server.exe";
----> then start the vls server, failed to load document:
vls: main.vala:207: Finished constructing
vls: main.vala:180: Got call! initialize
vls: main.vala:247: [initialize] root path is d:\Codelabs\GitHub\kangaroo
(process:89728): Json-CRITICAL **: 13:59:50.806: json_node_get_array: assertion 'JSON_NODE_IS_VALID (node)' failed
(process:89728): Json-CRITICAL **: 13:59:50.806: json_array_get_elements: assertion 'array != NULL' failed
vls: main.vala:172: Got notification! initialized
vls: main.vala:176: no notification handler for initialized
vls: main.vala:172: Got notification! textDocument/didOpen
vls: main.vala:531: failed to find text document for `d:\Codelabs\GitHub\kangaroo\src\main.vala'
vls: main.vala:180: Got call! textDocument/documentSymbol
vls: main.vala:531: failed to find text document for `d:\Codelabs\GitHub\kangaroo\src\main.vala'
vls: main.vala:960: [textDocument/documentSymbol] file `file:///d%3A/Codelabs/GitHub/kangaroo/src/main.vala' not found
- update client.ts to return the path returned by which command
getLanguageServerPath(): string | null {
let uri;
if (window.activeTextEditor) {
uri = window.activeTextEditor.document.uri;
} else {
uri = null;
}
// return workspace.getConfiguration('vls', uri).languageServerPath
return which.sync('vala-language-server', { nothrow: true })
|| which.sync('gvls', { nothrow: true })
}
the vls server can start, then output the follow log:
vls: main.vala:207: Finished constructing
vls: main.vala:180: Got call! initialize
vls: main.vala:247: [initialize] root path is d:\Codelabs\GitHub\kangaroo
(process:98056): Json-CRITICAL **: 14:04:44.170: json_node_get_array: assertion 'JSON_NODE_IS_VALID (node)' failed
(process:98056): Json-CRITICAL **: 14:04:44.170: json_array_get_elements: assertion 'array != NULL' failed
vls: main.vala:172: Got notification! initialized
vls: main.vala:176: no notification handler for initialized
vls: main.vala:172: Got notification! textDocument/didOpen
vls: main.vala:531: failed to find text document for `d:\Codelabs\GitHub\kangaroo\src\main.vala'
vls: main.vala:180: Got call! textDocument/documentSymbol
vls: main.vala:531: failed to find text document for `d:\Codelabs\GitHub\kangaroo\src\main.vala'
vls: main.vala:960: [textDocument/documentSymbol] file `file:///d%3A/Codelabs/GitHub/kangaroo/src/main.vala' not found
Prince781 commented
Please open this bug in https://github.com/benwaffle/vala-language-server
Prince781 commented
Okay, the first part of this bug belongs here.
The second part of this bug belongs in vala-language-server.
taozuhong commented
done, pls see:
vala-lang/vala-language-server#58