Open rchl opened 2 weeks ago
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
}
},
"LSP-typescript": {
"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 set those when enabling hybrid mode:
{
"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,
},
}
}
},
}
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 enabled