-
Notifications
You must be signed in to change notification settings - Fork 14
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
Go to definition doesn't work for functions with doc-strings #91
Comments
I suspect the culprit are that comment format, which might not be properly parsed by the embeded treesitter inside LSP. Meanwhile, i could just update the grammar and release a new patch version |
This would be very much welcome! I've faced a similar issue but with function autocomplete. Is there anything we can do to help? I've submitted a similar PR to the C3 zed extension recently (AineeJames/c3-zed#2). Notably, I updated the grammar to commit c3lang/tree-sitter-c3@10a78fb (a few commits after release 0.2.3) as it seemed to have some relevant improvements related to |
If you feel comfortable with go, one should go this route:
Once tests are passing again, it should be ready. |
(I had posted something earlier, but turns out I missed an error along the way, so now I got the correct results!) Indeed, it seems that the following tests fail. Unfortunately, I'm not proficient at Go so I'm not sure I'd be able to make them pass (and/or the exact steps for that), but I'll record them here for posterity. Let me know if you manage to take a stab at it. Failing tests
|
Okay, I had a bit of spare time so I took a stab at it, and I managed to make all parser tests pass at least. This involved removing some tests (like pre-0.6 enums) which no longer parse. However, AST tests are failing because enum members in the form You can check out my progress at main...PgBiel:c3-lsp:bump-tree-sitter-0.2.3 Let me know if you have any suggestions, or if you'd like to pick it up from here. EDIT: Notably, I couldn't make the test you introduced at e628c5a pass unless I added a semicolon, since otherwise it's just an error node now I think, i.e. it doesn't parse. |
Great! I will take a look and see how hard it is to adapt. That helps me a lot! |
Some improvements on your changes:
It had old enum syntax in pre 0.6 With these changes, it passed all tests for me. Please note I could not try it yet. |
Describe the bug
Go to definition doesn't jump to function in user project space if it has doc string before definition.
To Reproduce
Steps to reproduce the behavior:
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: