Skip to content
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

Wrong server selected #4454

Open
3 tasks done
rogorido opened this issue May 20, 2024 · 6 comments
Open
3 tasks done

Wrong server selected #4454

rogorido opened this issue May 20, 2024 · 6 comments
Labels

Comments

@rogorido
Copy link

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command: 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

  1. Fresh emacs install
  2. M-x lsp-start-plain
  3. open a JS file.

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

In lsp-log I have: 


Command "vue-language-server --stdio" is present on the path.
Command "semgrep lsp" is not present on the path.
Command "deno lsp" is not present on the path.
Command "typescript-language-server --stdio" is present on the path.
Command "vue-language-server --stdio" is present on the path.
Command "semgrep lsp" is not present on the path.
Command "deno lsp" is not present on the path.
Command "typescript-language-server --stdio" is present on the path.
Found the following clients for /home/igor/geschichte/web/code/apis/apiatlantocracies/main.js: (server-id vue-semantic-server, priority 0), (server-id ts-ls, priority -2)
The following clients were selected based on priority: (server-id vue-semantic-server, priority 0)


### Anything else?

_No response_
@rogorido rogorido added the bug label May 20, 2024
@erickisos
Copy link
Contributor

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.

@jcs090218
Copy link
Member

jcs090218 commented May 24, 2024

Try to configuring the variable lsp-enabled-clients.

@erickisos
Copy link
Contributor

Currently, that variable is empty, however, after manually installing the corresponding clients it apparently worked!

@jcs090218 jcs090218 added question and removed bug labels May 24, 2024
@alex-jara
Copy link

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.

@komali2
Copy link
Contributor

komali2 commented Jun 23, 2024

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.

@yyoncho
Copy link
Member

yyoncho commented Jun 24, 2024

M-x add-dir-local-variable with enabled/disabled clients should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants