Open rogorido opened 4 months ago
I just came here to mention that I'm having a similar issue.
Given that I opened a graphql file instead of a TSX one when opening the project lsp mode suggested Graphql-lsp server (which is cool for the gql file), but whenever I open a tsx, it doesn't change the selected client, and I can't select it using +lsp/switch-client
in doomemacs.
Try to configuring the variable lsp-enabled-clients.
Currently, that variable is empty, however, after manually installing the corresponding clients it apparently worked!
Experiencing the exact same problem as OP here. vue-semantic-server
is taking precedence over any other server when opening a file, even non-js-related ones. I noticed it only happens in workspaces where the vue server was used at least once, workspaces where I've not used it work normally. Working in multiple php+vue+typescript projects has made this a very annoying issue.
I'm using emacs-lsp
in Doom Emacs on macOS although I was able to replicate the problem in a new emacs installation.
I can switch to the correct server (and/or client, not sure about the correct term here) using +lsp/switch-client
in Doom to continue working so it seems that the problem is on file opening only.
I'm having this issue in spacemacs.
Modifying lsp-enabled-clients
is a silly solution. Whitelist all servers in order to blacklist one? I want to use vue-semantic-server
in vue files. I must modify this variable every time I'm editing a vue app? What about when I'm working on a vue and react app simultaneously?
Is there no other way to manually switch an LSP client? I've been paging through google for about an hour and turned up nothing.
M-x add-dir-local-variable with enabled/disabled clients should work.
I'm also having this issue, but for phpactor
and php-ls
.
It seems as though the check to ensure that php-language-server
exists is not called the first time lsp
is run. The check runs as expected if I run lsp
a second time.
Here's a snippet from my *lsp-log*
:
... (semgrep and serenata are not on path, phpactor is) ...
Found the following clients for [file]: (server-id phpactor, priority -4), (server-id php-ls, priority -3)
The following clients were selected based on priority: (server-id php-ls, priority -3)
... (semgrep and serenata are not on path, phpactor is) ...
[home dir]/.composer/vendor/felixfbecker/language-server/bin/php-language-server.php is not present.
Found the following clients for [file]: (server-id phpactor, priority -4)
The following clients were selected based on priority: (server-id phpactor, priority -4)
Hi, I'm in the same situation here, my project has .vue
files, .ts
files and .js
files, vue-semantic-server
always takes over.
Not sure if add-dir-local-variable
will be of any use, i have some .vue
files in the same directory as others.
Is there a way to set the priority based on the file extension? I don't see why everything is sent to vue-semantic-server
. IMO vue-semantic-server
should only handle .vue
files and nothing else...
Thank you for the bug report
lsp-mode
related packages.M-x lsp-start-plain
Bug description
Every time I open a JS file lsp-mode selects vue-semantic-server. Even if I remove all emacs.d/ related files (.emacs, .init.el, etc.). There is some configure which is getting loaded somewhere. Where could it be?
Steps to reproduce
Expected behavior
Open the JS files with ts-ls and not with vue-semantic-server
Which Language Server did you use?
lsp
OS
Linux
Error callstack