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

Goto definition: support for multiple lsps #12724

Closed

Conversation

junglerobba
Copy link
Contributor

Fall back to next configured language server if previous did not find a
location to go to.
Comment on lines +938 to +939
items = to_locations(location);
offset_encoding = encoding;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this uses the response from the last language server to respond successfully. I believe we want to merge the items instead

Copy link
Contributor Author

@junglerobba junglerobba Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My test case for this was configuring typescript files to have both the typescript and angular language servers, in that order. So usually the first response from the typescript language server was fine, except for template strings, where angular would respond instead. So simply using the first valid response from the configured language servers in order was sufficient. But I think this should be fine as well, I just didn't want for goto definition to open a selection popup in the case that multiple language servers respond.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has however introduced a new issue: #12732

@the-mikedavis
Copy link
Member

I have pushed up f7394d5 which should cover #11689. It's ultimately the same as this change (so I marked you as a co-author) but it's merging the responses and also making a refactor to inline the to_locations helper

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

Successfully merging this pull request may close these issues.

2 participants