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
Force recalc of line offsets for each document change #405
Force recalc of line offsets for each document change #405
Conversation
Side note: I could write some quick and dirty tests that confirm this is working correctly, but all of the existing tests seem to be much more end-to-end in scope. Should I go ahead and write said tests even if they don't fit very well with those already existing? Side side note: hard to see much benefit to writing an additional test when the tests and CI have been broken for so long. |
Yes, I think that would be great! In general, it would actually be fantastic if we didn't just have these end-to-end tests, but proper unit tests.
I just went through the whole packages, tagged some releases and tried to fix as much CI problems as I can right now. Much is passing now, with the following exceptions: Julia 1.3 32 bit is broken (not our fault), Julia 1.0 and 1.1 are broken for anything downstream from SymbolServer.jl due to julia-vscode/SymbolServer.jl#49. I think all other tests should be passing right now on all the |
EDIT: I see there have been additional changes that got a lot of tests running since I opened the PR. Will rebase and let CI run again. Please ignore this comment, and thanks for all your work in getting the tests working again. It's much appreciated. |
1d7e67c
to
1ba17d0
Compare
Codecov Report
@@ Coverage Diff @@
## master #405 +/- ##
==========================================
+ Coverage 32.97% 33.14% +0.16%
==========================================
Files 22 22
Lines 1219 1219
==========================================
+ Hits 402 404 +2
+ Misses 817 815 -2
Continue to review full report at Codecov.
|
2a7dc09
to
f6965e8
Compare
f6965e8
to
c664531
Compare
This should be good to go. I feel much better about the correctness of the change since it unbroke a broken test. |
@ZacLN same thing as with the others: I'm merging this, but would be good if you could review after the fact. |
Closes #403
The problem is that
Document._line_offsets
isn't updated until all changes from a particular rpc message have been processed. I think this bug hasn't been seen before becausetextDocument/didChange
with multiple changes are rare in practice. There may be a more performant way of updating the offsets for each change, but this should at least fix the problem.