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: Fix enum destructuring/id linking to other types with the same name #628

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

jansul
Copy link
Contributor

@jansul jansul commented Aug 19, 2023

Noticed a bug when working on a fix for the issue mentioned in my last PR.

When doing "Go to Definition" on an Ast::EnumId or Ast::EnumDestructuring node, if their .option field matched the name of an existing component, store etc, then it would link to that instead.

Here's an example of the issue in video form:

2023-08-19.12-05-20.mp4

The fix here was to stop tracking Ast::TypeId within these two nodes, as hover/definition etc use the higher level nodes to provide their features anyway.

@Sija Sija added bug Something isn't working tooling Tooling related feature (formatter, documentation, production builder) labels Aug 19, 2023
@Sija Sija added this to the 0.19.0 milestone Aug 19, 2023
@Sija Sija requested a review from gdotdesign August 19, 2023 11:32
@gdotdesign
Copy link
Member

The fix here was to stop tracking Ast::TypeId within these two nodes, as hover/definition etc use the higher level nodes to provide their features anyway.

Would this mean that the options are not linkable themselves, just the enum itself?

@jansul
Copy link
Contributor Author

jansul commented Aug 21, 2023

Would this mean that the options are not linkable themselves, just the enum itself?

That still works thanks to the use of cursor_intersects? within the enum_id definition file.

In hindsight we might not actually need that method, instead just looking through the stack as we do for module access.. But possible one for another refactoring 🙈

@gdotdesign
Copy link
Member

That still works thanks to the use of cursor_intersects? within the enum_id definition file.

Ah yeah, that was what I was missing :)

@gdotdesign gdotdesign merged commit 2d371e9 into mint-lang:master Aug 22, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tooling Tooling related feature (formatter, documentation, production builder)
Development

Successfully merging this pull request may close these issues.

3 participants