-
Notifications
You must be signed in to change notification settings - Fork 3
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
Implement hybrid mode support #130
Comments
A current blocker is related to making the Vue Typescript plugin easy to set up with LSP-typescript. Setting up Vue Typescript plugin basically means adding a configuration like this in project settings: "settings": {
"LSP": {
"LSP-vue": {
"initializationOptions": {
"vue.hybridMode": true
},
// Preferred for handling requests in Vue files over LSP-typescript.
"priority_selector": "text.html.vue source.js, text.html.vue source.ts",
"disabled_capabilities": {
"definitionProvider": true,
"referencesProvider": true,
"typeDefinitionProvider": true,
},
},
"LSP-typescript": {
"selector": "source.js, source.jsx, source.ts, source.tsx, text.html.vue",
"initializationOptions": {
"plugins": [
{
"languages": ["vue"],
"location": "/Users/rafal/Library/Caches/Sublime Text/Package Storage/LSP-vue/20.18.0/server/node_modules",
"name": "@vue/typescript-plugin",
}
],
},
},
}
}, The problem is the path to the plugin which is not know up-front (it's only known once the LSP-vue is initialized and also it's not ideal that it includes the node version since it means that this setup will break and will have to be updated once node version is updated. I'd rather define some variable that would provide path to the LSP-vue node_modules but as said before, it's not that straightforward since that path is not known until server is initialized. I was thinking of maybe copying the vue typescript plugin to a different location but that doesn't sound that great either IMO. |
For the record (if someone wants to use hybrid mode before it's officially supported), to fix some issues with requests prioritization, it's recommended to also disable some capabilities and set priority_selector. I've updated configuration above with those. |
I activated hybrid mode, and updated the settings, but I don't get diagnostics in my .vue files, neither in the html nor in the script part. The logs:
LSP log when hovering over an undefined variable
Maybe it's a Windows problem? |
I think |
I've edited the comments to just have one configuration instead of confusing two different ones. But yeah, LSP-typescript must be running also. |
Thanks! It works now. One other thing I had wrong was that I used unix style path for the plugin path, which does not work in Windows. So LSP-typescript started without the plugin and I got garbage diagnostics in .vue files. It would be cool if LSP-vue or LSP-typescript could validate the plugin path somehow. Or maybe typescript does it but it's not reported. |
This is what @rchl is trying to automate. |
vue.hybridMode
is a mode whereLSP-vue
works together withLSP-typescript
(with Vue Typescript plugin enabled) where each handles different functionality within the vue file.vue.hybridMode
is currently disabled and not recommended because:LSP-typescript
is a bit cumbersome and I want to provide some helper command for thatLSP-typescript
andLSP-vue
running together in a vue file fight over which one should handle requests and those don't always end up going to proper servers - this can be fixed by disabling certain capabilities forLSP-vue
when hybrid mode is enabledThe text was updated successfully, but these errors were encountered: