-
-
Notifications
You must be signed in to change notification settings - Fork 299
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 fallback logic in analysis.getPositionContext
#1754
Fix fallback logic in analysis.getPositionContext
#1754
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1754 +/- ##
=======================================
Coverage 76.58% 76.59%
=======================================
Files 35 35
Lines 10088 10090 +2
=======================================
+ Hits 7726 7728 +2
Misses 2362 2362 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like something that could be covered by a test case in position_context.zig.
63a54a8
to
161e51f
Compare
Having done this makes me realize having that logic is very dicey and zls/src/features/completions.zig Line 1338 in 05ae41e
should just use tok_loc.end orzls/src/features/completions.zig Line 1197 in 05ae41e
look_ahead = true here (haven't tested for side effects). |
161e51f
to
b4d49a9
Compare
This is a low priority PR, the test changes are worth having, but in my opinion the fallback logic shouldn't exist (and obviously nothing depends on it currently). |
Most lines are indented, ie
line[0] == ' '
(a space).Tokenizing
line
as the sole buffer returns location offsets relative/within to that line, but are expected to be indexes withinhandle.tree.source
.