neoclide / coc.nvim

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
Other
24.15k stars 953 forks source link

Fix Completion Blocked by `incomplete` Item #5029

Open hexh250786313 opened 1 month ago

hexh250786313 commented 1 month ago

Should fix https://github.com/neoclide/coc.nvim/issues/5028.

This pull request is still under testing.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 66.66667% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 98.51%. Comparing base (ba3c0a9) to head (7adbccb).

Files Patch % Lines
src/completion/pum.ts 0.00% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #5029 +/- ## ========================================== - Coverage 98.51% 98.51% -0.01% ========================================== Files 273 273 Lines 26072 26068 -4 Branches 5389 5388 -1 ========================================== - Hits 25684 25680 -4 + Misses 228 226 -2 - Partials 160 162 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

hexh250786313 commented 3 weeks ago

https://github.com/neoclide/coc.nvim/blob/7adbccbe8fa08a1c5031f62f8d2c6296f49e94b8/src/completion/pum.ts#L175-L177

It defaults to setting the first item as the selected state. For incompletion items with high priority values, they become the top item every time after refresh, causing them to be selected by default even if preselect is not configured. I must say, this behavior is a bit annoying. Need to fix.