-
-
Notifications
You must be signed in to change notification settings - Fork 949
lsp--capf-cached-items: dont group on prefix anymore #1774
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
Conversation
|
Can you do this PR against plists branch? We should focus on it otherwise it will never be merged. |
20e366c to
93b1111
Compare
|
Done |
| (when (string-match fuz-query cand) | ||
| (setq cand (copy-sequence cand)) | ||
| (put-text-property 0 1 'match-data (match-data) cand) | ||
| (put-text-property 0 1 'completion-score (lsp--fuzzy-score query cand) cand) |
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.
can we calculate the completion-score here and remove the OR bellow? Also, access completion-score directly instead of using the get-text-property.
| (plist-put fuz-queries start-point s)) | ||
| s)))) | ||
| (when (string-match fuz-query cand) | ||
| (setq cand (copy-sequence cand)) |
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.
why this is needed? We should strive to reduce memory usage in this critical section. Note that dart language server might return 20k+ completion items.
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.
I modified the cached candidates to adding match-data and stuff so just copy the candidates to make sure.
| (put-text-property 0 1 'completion-score (lsp--fuzzy-score query cand) cand) | ||
| cand))) | ||
| items)) | ||
| (-sort (-on #'> (lambda (o) |
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.
we should remove the usage of -sort in favour of sort in completion hotpath.
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.
Ok
| (put-text-property 0 1 'completion-score (lsp--fuzzy-score query cand) cand) | ||
| cand))) | ||
| items)) | ||
| (-sort (-on #'> (lambda (o) |
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.
-on would introduce some additional funcall - can we replace it with lambda?
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.
Sure
|
And there is one more thing that we should do - use |
Good point, I will do that |
Hm, we should be careful, because this might not work, e. g. when user does company select next item we should not cancel the calculations... |
Since we're using
lsp--fuzzy-score, there's no need for grouping candidates prefix anymore.