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

Fix go to definition when server returns LocationLink #331

Merged
merged 1 commit into from
Aug 4, 2023

Conversation

FalsePattern
Copy link
Contributor

@FalsePattern FalsePattern commented Jul 29, 2023

Purpose

"Go to definition" completely breaks down when using LSP4IntelliJ for connecting to the Zig Language Server.
The source of this issue was that ZLS returns a LocationLink instead of a Location in the reply to the definition call, and this causes lsp4intellij to "spazz out", and open dozens of unrelated editors.

Goals

Implement a basic way for interpreting LocationLink without affecting too much of the codebase.

Approach

LocationLink contains all of the information necessary to construct a Location object, so I just added a trivial conversion to the EditorEventManager.requestDefinition method.

User stories

I have personally experienced this problem while developing a Zig language plugin for intellij using this library.
Once the fix was implemented in a local fork, go to definition started working normally again.

Release note

Added basic compatibility with LocationLink responses for definition lookups.

@CLAassistant
Copy link

CLAassistant commented Jul 29, 2023

CLA assistant check
All committers have signed the CLA.

@NipunaRanasinghe NipunaRanasinghe merged commit 52eca94 into ballerina-platform:master Aug 4, 2023
4 checks passed
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.

3 participants