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

lsp-bash: only take into account buffer-local sh-shell #4675

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

fredericgiquel
Copy link
Contributor

Recent changes (#4620) make lsp-bash eligible for all buffers if Emacs is launch from a bash shell. It's because sh-shell is a global variable and its value is set to the shell used to launch Emacs (and there is no more major-mode check in lsp-bash-check-sh-shell).

This can lead to choose the wrong server (depending on priorities). For example, if I open a typescript file, I can observe the following logs:

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 "bash-language-server start" is present on the path.
Found the following clients for /home/fred/Projets/test/test.ts: (server-id ts-ls, priority -2), (server-id bash-ls, priority -1)
The following clients were selected based on priority: (server-id bash-ls, priority -1)

To fix the problem, we can reintroduce major-mode check or only take into account buffer-local sh-shell (as proposed by this PR). Feel free to choose the solution you prefer.

@github-actions github-actions bot added the client One or more of lsp-mode language clients label Jan 6, 2025
@jcs090218 jcs090218 merged commit e9230e8 into emacs-lsp:master Jan 6, 2025
10 of 13 checks passed
@jcs090218
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client One or more of lsp-mode language clients
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants