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

Basic go-to-definition inside functions #63

Merged
merged 1 commit into from
Sep 2, 2022

Conversation

julienduchesne
Copy link
Member

When processing the index list, the language server will now go through function bodies to find fields
This will only occur when the function's body is directly a DesugaredObject
This doesn't support all cases. I will probably have to add more, I have already identified cases which are even more complex that do not work yet, but this is a good first step

In the go-to-functions-advanced.libsonnet file, this allows us to find the arg2 field accessed later on, even though it's a field created by a function

When processing the index list, the language server will now go through function bodies to find fields
This will only occur when the function's body is directly a DesugaredObject
This doesn't support all cases. I will probably have to add more, I have already identified cases which are even more complex that do not work yet, but this is a good first step
@julienduchesne julienduchesne merged commit 49a3b9b into main Sep 2, 2022
@julienduchesne julienduchesne deleted the julienduchesne/basic-go-to-function branch September 2, 2022 22:58
julienduchesne added a commit that referenced this pull request Oct 12, 2022
Started in #63 and #70
I think this now covers all (or most) cases
Most of this PR is just tests, since the missing code was just missing a few cases in switch cases
julienduchesne added a commit that referenced this pull request Oct 12, 2022
Started in #63 and #70
I think this now covers all (or most) cases
Most of this PR is just tests, since the missing code was just missing a few cases in switch cases
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.

1 participant