Skip to content
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

feat: replace wilder by cmp.cmdline #929

Closed
wants to merge 1 commit into from
Closed

Conversation

fecet
Copy link
Contributor

@fecet fecet commented Aug 3, 2023

@Jint-lzxy
Copy link
Collaborator

Possible edge cases are described in #926 (comment) and #926 (comment). This is the main reason preventing us from introducing this change.

@fecet
Copy link
Contributor Author

fecet commented Aug 3, 2023

I haven't used wilder for a while, what makes statusline of wilder special

@Jint-lzxy
Copy link
Collaborator

I haven't used wilder for a while, what makes statusline of wilder special

Wilder integrates better with "stuffs outside Neovim" - e.g., cmp.cmdline doesn't provide completions for files under cwd, :Man pages, shellcmds, etc. But what makes me question the potential benefits this PR may bring is closely related to how nvim-cmp sorts its entries:

sorting = {
priority_weight = 2,
comparators = {
require("copilot_cmp.comparators").prioritize,
require("copilot_cmp.comparators").score,
-- require("cmp_tabnine.compare"),
compare.offset, -- Items closer to cursor will have lower priority
compare.exact,
-- compare.scopes,
compare.lsp_scores,
compare.sort_text,
compare.score,
compare.recently_used,
-- compare.locality, -- Items closer to cursor will have higher priority, conflicts with `offset`
require("cmp-under-comparator").under,
compare.kind,
compare.length,
compare.order,
},
},

- We didn't take cmp-cmdline into consideration while adjusting sorting.comparators (which will also be used to filter/sort those cmdline completions) - IMO calling those whole bunch of comparators will be a complete overkill; This implies to support cmp.cmdline without causing performance overhead, we must change those sorting criteria exclusively for cmp-cmdline; the formatting of these entries also needs to be changed, as meta information about those slots no longer becomes relevant and could be misleading. FWIW it would be better to have a plugin focus on "what it's mainly designed for", what's the motivation behind this change?

@fecet fecet marked this pull request as draft August 3, 2023 16:34
@fecet
Copy link
Contributor Author

fecet commented Aug 3, 2023

I am not quite sure how the performance of cmp is affected, and I have gotten used to its slowness (due to the inherent issues of Python LSP and Copilot, it's unlikely to be fast). Are you referring to the completion of :Man and :! in command mode? For file paths, it seems to work.

I just cherrypick something in my config in case someone else may found useful :)

@Jint-lzxy
Copy link
Collaborator

Jint-lzxy commented Aug 3, 2023

Are you referring to the completion of :Man and :! in command mode? For file paths, it seems to work.

Ys. But there're several corner cases for file paths, e.g., too many nested dir changes like ../../.././../. This is b/c cmp.cmdline itself does not perform any sort of analysis, it's just a wrapper around Vim's default completion engine (which means it "inherits" all the problems of omnicomp).

I am not quite sure how the performance of cmp is affected, and I have gotten used to its slowness

I have been experiencing input lags while trying to specialize configs for cmp.cmdline these days (which was not the case before). After I removed sorting.comparators, everything went fine - so I doubt something must be wrong there.

I just cherrypick something in my config in case someone else may found useful :)

Yeah it's just a matter of taste & perference, and Neovim is (as always) supposed to be a PDE, not an IDE 😄 Just curious, is there any issue regaring wilder.nvim that motivated u to make this change?

@fecet
Copy link
Contributor Author

fecet commented Aug 4, 2023

can't really remember maybe just cause it's dead/written by vim/have to fixed stuffs like #923

@ayamir
Copy link
Owner

ayamir commented Aug 4, 2023

Don't think cmdline better than wilder. But wilder is not updated for about a year, this is a hidden danger.

@fecet fecet closed this Aug 6, 2023
@fecet fecet deleted the feat/cmdline branch August 6, 2023 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants