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

Respect the language_servers setting's order when determining the primary language server #15624

Merged
merged 2 commits into from
Aug 1, 2024

Conversation

maxdeviant
Copy link
Member

This PR updates how we determine the "primary" language server for a buffer to make it respect the order specified by the language_servers setting.

Previously we were relying on the language servers to be registered in the right order in order to select the primary one effectively.

However, in my testing I observed some cases where a native language server (e.g., tailwindcss-language-server) could end up first in the list of language servers despite not being first in the language_servers setting.

While this wasn't a problem for the Tailwind or ESLint language servers on account of them being defined natively with the designation of "secondary" language servers, this could cause problems with extension-based language servers.

To remedy this, every time we start up language servers we reorder the list of language servers for a given language to reflect the order in the language_servers setting. This ordering then allows us to treat the first language server in the list as the "primary" one.

Related issues:

Release Notes:

  • The ordering of language servers will now respect the order in the language_servers setting.
    • The first language server in this list will be used as the primary language server.

@maxdeviant maxdeviant self-assigned this Aug 1, 2024
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Aug 1, 2024
@maxdeviant maxdeviant merged commit 3bd9a3f into main Aug 1, 2024
9 checks passed
@maxdeviant maxdeviant deleted the marshall/fix-language-server-ordering branch August 1, 2024 15:58
mrnugget added a commit that referenced this pull request Aug 1, 2024
Follow-up to #15624.

Since #15624 introduced a fix for the language server ordering,
this fixes the ordering in the Ruby docs.
mrnugget added a commit that referenced this pull request Aug 1, 2024
Follow-up to #15624.

Since #15624 introduced a fix for the language server ordering, this
fixes the ordering in the Ruby docs.

Release Notes:

- N/A
maxdeviant added a commit that referenced this pull request Aug 1, 2024
This PR removes the primary/secondary distinction for
`CachedLspAdapter`s.

After #15624 we weren't relying on the `is_primary` field anywhere, so
we can remove it.

Release Notes:

- N/A
SomeoneToIgnore added a commit that referenced this pull request Aug 22, 2024
… their languages (#16654)

Follow-up of #15624

Fixes #13769
Fixes #16469

This way, those are considered "primary" and serve all LSP requests like
go to definition. Before, Tailwind language server was first and
returned nothing for all LSP requests.

- Fixed Vue and Svelte languages integrations not handling LSP requests
properly ([#13769](#13769))
([#16469](#16469))
SomeoneToIgnore added a commit that referenced this pull request Aug 22, 2024
… their languages (#16654)

Follow-up of #15624

Fixes #13769
Fixes #16469

This way, those are considered "primary" and serve all LSP requests like
go to definition. Before, Tailwind language server was first and
returned nothing for all LSP requests.

- Fixed Vue and Svelte languages integrations not handling LSP requests
properly ([#13769](#13769))
([#16469](#16469))
SomeoneToIgnore added a commit that referenced this pull request Aug 22, 2024
… their languages (#16654)

Follow-up of #15624

Fixes #13769
Fixes #16469

This way, those are considered "primary" and serve all LSP requests like
go to definition. Before, Tailwind language server was first and
returned nothing for all LSP requests.

- Fixed Vue and Svelte languages integrations not handling LSP requests
properly ([#13769](#13769))
([#16469](#16469))
gcp-cherry-pick-bot bot pushed a commit that referenced this pull request Aug 22, 2024
… their languages (#16654)

Follow-up of #15624

Fixes #13769
Fixes #16469

This way, those are considered "primary" and serve all LSP requests like
go to definition. Before, Tailwind language server was first and
returned nothing for all LSP requests.

- Fixed Vue and Svelte languages integrations not handling LSP requests
properly ([#13769](#13769))
([#16469](#16469))
gcp-cherry-pick-bot bot pushed a commit that referenced this pull request Aug 22, 2024
… their languages (#16654)

Follow-up of #15624

Fixes #13769
Fixes #16469

This way, those are considered "primary" and serve all LSP requests like
go to definition. Before, Tailwind language server was first and
returned nothing for all LSP requests.

- Fixed Vue and Svelte languages integrations not handling LSP requests
properly ([#13769](#13769))
([#16469](#16469))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant