-
-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vls doesn't work with monaco-languageclient. #3401
Comments
Whether to support worker like this: import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker';
import vueWorker from 'vls/vue.worker'; <--- here
self.MonacoEnvironment = {
getWorker(_: any, label: string) {
console.log(label, '==label');
if (label === 'json') {
return new jsonWorker();
}
if (label === 'vue') { <---- and here
return new vueWorker();
}
if (label === 'html' || label === 'handlebars' || label === 'razor') {
return new htmlWorker();
}
return new editorWorker();
}
}; |
what errors are you seeing? Vetur has several ways to log and debug attach to lsp server. If the initialization process fails, either monaco or vetur will tell you about it afaik. |
@phil294 thank you for reply There is no error when run server. looks like as below: And code like this: connection.onInitialize(async (params) => {
await _vls.init(params);
console.log("Vetur initialized =====");
return {
capabilities: _vls.capabilities,
};
}); |
@phil294 |
I found textDocument/didOpen event get wrong params like: {
jsonrpc: '2.0',
method: 'textDocument/didOpen',
params: {
textDocument: {
uri: 'inmemory://model/1', <----- I think this is incorrect uri
languageId: 'vue',
version: 1,
text: ''
}
}
} I'm not pass default value for monaco-editor, so it is no content by default. and the uri of textDocument looks like the source code stored in the memory? how to resolve this problem? thanks~ |
here is the repo about thi question: repo |
here is related issue |
anybody? help~ @HerringtonDarkholme @yoyo930021 sorry to disturb~ 🙏🏻 |
i used https://github.com/wylieconlon/jsonrpc-ws-proxy and, with a couple of configuration bits inside of the client.ts, had it up and running (syntax, suggestions, etc). Only syntax highlighting to go. the workspaceFolder inside of the clientOptions (in client.js), i set it to the folder where the server's files live. This article was invaluable: https://medium.com/dscddu/language-server-protocol-adding-support-for-multiple-language-servers-to-monaco-editor-a3c35e42a98d i can't pretend to know exactly how it's working as yet, because documentation on some of these things is very slim and right now it's just about getting it working - the end target is Volar, but that doesn't seem to integrate in the same way :-p Good luck. |
@redbullmarky |
The vetur can't work well in environments other than nodejs. Vetur is based on typescript language service. |
Vetur: Restart VLS
Info
Problem
I changed json to vue of node demo of monaco-languageclient as below:
But it is not work after those change.
So how to connect monaco-editor with vls?
Any answer would be greatly appreciated. thank you!
Reproducible Case
As above.
The text was updated successfully, but these errors were encountered: