-
Notifications
You must be signed in to change notification settings - Fork 770
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
[READY] Calculate the start codepoint when we don't resolve items in LSC #905
Conversation
e118fa0
to
46a7b9e
Compare
Codecov Report
@@ Coverage Diff @@
## master #905 +/- ##
==========================================
+ Coverage 96.18% 96.19% +0.01%
==========================================
Files 83 83
Lines 6468 6496 +28
==========================================
+ Hits 6221 6249 +28
Misses 247 247 |
Reviewed 5 of 5 files at r1, 2 of 2 files at r2. ycmd/completers/language_server/language_server_completer.py, line 786 at r1 (raw file):
ycmd/completers/language_server/language_server_completer.py, line 1483 at r1 (raw file):
ycmd/completers/language_server/language_server_completer.py, line 1531 at r1 (raw file):
ycmd/completers/language_server/language_server_completer.py, line 1532 at r1 (raw file):
ycmd/completers/language_server/language_server_completer.py, line 1540 at r1 (raw file):
One blank line is enough. ycmd/tests/request_wrap_test.py, line 63 at r1 (raw file):
Space before Comments from Reviewable |
Resolving lots of completion items is very slow, so we only do that if there are 100 or feweer completions. Most unfortunately Visual Studio Code does some heuristics on completion items, so that any overlap with existing code is replaced, rather than appended. This happens to be how jdt.ls returns import completions. It's common for there to be more than 100 suggestions when typing, say 'import com.'. This leads to bad behaviour where the insertion ends up being 'com.com.youcompletme...' which is clearly wrong. To combad this, when we don't have a textEdit to apply, we detect any overlap between the insertion_text and the existing text (up to the completion location) and offset the start_codepoint by that much. The overlap detection algorithm is efficient (see the link) and simpler than a dynamic programming one. Incidentally, we add the 'prefix' key to request_wrap to avoid recalculating it for each element.
46a7b9e
to
3209927
Compare
Review status: 3 of 5 files reviewed at latest revision, 6 unresolved discussions, some commit checks pending. ycmd/completers/language_server/language_server_completer.py, line 786 at r1 (raw file): Previously, micbou wrote…
Done. ycmd/completers/language_server/language_server_completer.py, line 1483 at r1 (raw file): Previously, micbou wrote…
Done. ycmd/completers/language_server/language_server_completer.py, line 1531 at r1 (raw file): Previously, micbou wrote…
Done. ycmd/completers/language_server/language_server_completer.py, line 1532 at r1 (raw file): Previously, micbou wrote…
Done. ycmd/completers/language_server/language_server_completer.py, line 1540 at r1 (raw file): Previously, micbou wrote…
Done. ycmd/tests/request_wrap_test.py, line 63 at r1 (raw file): Previously, micbou wrote…
Done. Comments from Reviewable |
Reviewed 2 of 2 files at r3. ycmd/request_wrap.py, line 193 at r3 (raw file):
Parentheses are not needed (see the Comments from Reviewable |
Review status: all files reviewed at latest revision, 1 unresolved discussion. ycmd/request_wrap.py, line 193 at r3 (raw file): Previously, micbou wrote…
I kinda like them for the clarity. The Comments from Reviewable |
Review status: all files reviewed at latest revision, 1 unresolved discussion. ycmd/request_wrap.py, line 193 at r3 (raw file): Previously, puremourning (Ben Jackson) wrote…
If you think this improves readability then we should keep them. Comments from Reviewable |
@zzbot r=micbou Reviewed 2 of 5 files at r1, 1 of 2 files at r2, 2 of 2 files at r3. Comments from Reviewable |
📌 Commit 3209927 has been approved by |
[READY] Calculate the start codepoint when we don't resolve items in LSC Resolving lots of completion items is very slow, so we only do that if there are 100 or feweer completions. Most unfortunately Visual Studio Code does some heuristics on completion items, so that any overlap with existing code is replaced, rather than appended. This happens to be how jdt.ls returns import completions. It's common for there to be more than 100 suggestions when typing, say 'import com.'. This leads to bad behaviour where the insertion ends up being 'com.com.youcompletme...' which is clearly wrong. To combad this, when we don't have a textEdit to apply, we detect any overlap between the insertion_text and the existing text (up to the completion location) and offset the start_codepoint by that much. The overlap detection algorithm is efficient (see the link) and simpler than a dynamic programming one. Incidentally, we add the 'prefix' key to request_wrap to avoid recalculating it for each element. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/905) <!-- Reviewable:end -->
☀️ Test successful - status-appveyor, status-travis |
[READY] Update ycmd Include the following changes: - PR ycm-core/ycmd#789: add support for Windows flags when --driver-mode=cl is given; - PR ycm-core/ycmd#848: hide C++ symbols by default; - PR ycm-core/ycmd#857: add Java support using jdt.ls; - PR ycm-core/ycmd#861: translate libclang error codes to exceptions; - PR ycm-core/ycmd#880: support downloading Clang binaries on ARM systems; - PR ycm-core/ycmd#883: handle zero column diagnostic from OmniSharp; - PR ycm-core/ycmd#884: specify Platform property when compiling OmniSharp; - PR ycm-core/ycmd#886: use current working directory in JavaScript completer; - PR ycm-core/ycmd#887: update Boost to 1.66.0; - PR ycm-core/ycmd#888: update JediHTTP; - PR ycm-core/ycmd#889: update Clang to 5.0.1; - PR ycm-core/ycmd#891: fix building with system libclang on Gentoo amd64; - PR ycm-core/ycmd#904: drop Python 2.6 and Python 3.3 support; - PR ycm-core/ycmd#905: calculate the start column when items are not resolved in the language server completer; - PR ycm-core/ycmd#912: download Clang binaries from HTTPS; - PR ycm-core/ycmd#914: do not try to symlink libclang on Windows. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2902) <!-- Reviewable:end -->
Resolving lots of completion items is very slow, so we only do that if
there are 100 or feweer completions.
Most unfortunately Visual Studio Code does some heuristics on completion
items, so that any overlap with existing code is replaced, rather than
appended. This happens to be how jdt.ls returns import completions.
It's common for there to be more than 100 suggestions when typing,
say 'import com.'. This leads to bad behaviour where the insertion ends
up being 'com.com.youcompletme...' which is clearly wrong.
To combad this, when we don't have a textEdit to apply, we detect any
overlap between the insertion_text and the existing text (up to the
completion location) and offset the start_codepoint by that much.
The overlap detection algorithm is efficient (see the link) and simpler
than a dynamic programming one.
Incidentally, we add the 'prefix' key to request_wrap to avoid
recalculating it for each element.
This change is