-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Performance improvements and other fixes in code completion #3146
Merged
vparfonov
merged 8 commits into
eclipse-che:master
from
kaloyan-raev:code-assist-widget
Nov 30, 2016
Merged
Performance improvements and other fixes in code completion #3146
vparfonov
merged 8 commits into
eclipse-che:master
from
kaloyan-raev:code-assist-widget
Nov 30, 2016
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Kaloyan Raev <[email protected]>
Can one of the admins verify this patch? |
Signed-off-by: Kaloyan Raev <[email protected]>
If the isIncomplete flag is false, i.e. the completion result is complete, then additional typing for the same word should not trigger a new completion request. The latest completion result should be reused. Signed-off-by: Kaloyan Raev <[email protected]>
Signed-off-by: Kaloyan Raev <[email protected]>
Signed-off-by: Kaloyan Raev <[email protected]>
Signed-off-by: Kaloyan Raev <[email protected]>
Signed-off-by: Kaloyan Raev <[email protected]>
vparfonov
approved these changes
Nov 30, 2016
JPinkney
pushed a commit
to JPinkney/che
that referenced
this pull request
Aug 17, 2017
…che#3146) * Avoid overloading the DOM tree of the ContentAssistWidget Signed-off-by: Kaloyan Raev <[email protected]> * Ensure the code assist widget is closed when applying proposal Signed-off-by: Kaloyan Raev <[email protected]> * Respect isIncomplete flag in the completion result If the isIncomplete flag is false, i.e. the completion result is complete, then additional typing for the same word should not trigger a new completion request. The latest completion result should be reused. Signed-off-by: Kaloyan Raev <[email protected]> * Fix flickering between keystrokes during code completion Signed-off-by: Kaloyan Raev <[email protected]> * Fine tune the rules for making new completion request Signed-off-by: Kaloyan Raev <[email protected]> * Set the correct offset when applying code completion * Force a completion request message on Ctrl+Space Signed-off-by: Kaloyan Raev <[email protected]> * Fixed retrieval of CompletionItem document via Resolve request Signed-off-by: Kaloyan Raev <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR contains performance improvements for the code completion discussed in #2815.
Issue 1. Avoid overloading the DOM tree when creating the content assist widget.
Instead of adding a
<li>
element to the DOM tree for each proposal item, now there are no more than 50 elements added for displaying the available proposals. Thescroll
event is handled to update this fixed number of elements.An "extra top row" and an "extra bottom row" are introduced to simulate a full list of items in the browser. These extra rows are empty and their height is adjusted as necessary to place the list's scrollbar in the correct scroll position and with the correct height. These extra rows are never visible to users.
An "id" attribute with the index number is added to the
<li>
elements. It is necessary for the key navigation from the currently selected element. As the selected element may go out the buffered range when scrolling, the index in the "id" attribute is used to determine the newly selected element on key navigation (up, down, pageup, pagedown).Additional care is taken to keep the keyboard focus adequate. This is necessary because the currently focused
<li>
element may go out of range when scrolling, and the browser will move the focus to another element in the DOM tree, outside of the ContentAssistWidget.Issue 2. respect the
CompletionList.isIncomplete
flag.The latest completion result is stored in the
LatestCompletionResult
object. If the result is "complete", i.e. theisIncomplete
flag isfalse
, then the latest completion result is checked if it is still good for the current document position. In such case no new completion request is sent and the latest completion result is reused after filtering.A completion request is always sent if the user hits Ctrl+Space, regardless if there is a good latest completion result for the same position.
Other fixes
What issues does this PR fix or reference?
Fixes #2815: Performance issues with code completion
Previous behavior
The initial invocation of code completion took several seconds, especially when the the list of completion proposals is long. Subsequent key stroke may also cause noticeable UI freeze.
New behavior
Smoother experience with code completion. Faster initial response, no freeze on further typing.
Signed-off-by: Kaloyan Raev [email protected]