Commit Graph

13 Commits

Author SHA1 Message Date
4e90bc3023 feat(lsp): lsp.completion support set deprecated (#29882)
Problem: CompletionItem in lsp spec mentioned the deprecated attribute

Solution: when item has deprecated attribute set hl_group to DiagnosticDeprecated
          in complete function
2024-07-31 16:15:34 +02:00
aec7f1979a fix(lsp): fallback to label for completion items if all others are missing (#29522) 2024-07-02 18:27:51 +02:00
724d1110b1 fix(lsp): pre-filter matches on label if filterText is missing (#29491)
Although the built-in pum completion mechanism will filter anyway on the
next input it is odd if the initial popup shows entries which don't
match the current prefix.

Using fuzzy match on the label/prefix is compatible with
`completeopt+=fuzzy` and also doesn't seem to break postfix snippet
cases

Closes https://github.com/neovim/neovim/issues/29287
2024-06-27 12:20:00 +02:00
aa47af7e69 fix(lsp): tune completion word extraction for decorated labels (#29331)
Problem:

For snippets lsp.completion prefers the label if it is shorter than the
insertText or textEdit to support postfix completion cases but clangd
adds decoration characters to labels. E.g.: `•INT16_C(c)`

Solution:

Use parse_snippet on insertText/textEdit before checking if it is
shorter than the label.

Fixes https://github.com/neovim/neovim/issues/29301
2024-06-14 19:32:34 +02:00
8cbb1f20e5 refactor(lua): use tuple syntax everywhere #29111 2024-06-04 06:06:02 -07:00
5aa9906676 fix(lsp): use client.id instead of pairs index (#29143)
Problem: Completion side effects not working randomly.

Solution: When creating the table of LSP responses, the table index
was used, but this is not the same as the actual client_id, so it was changed
to use the client_id directly.
2024-06-03 18:07:09 +02:00
19be3d2683 fix(lsp): trim trailing whitespace from completion words (#29122)
the `complete()` mechanism doesn't play nicely with trailing newlines or
tabs. A newline causes it to insert a null character, showing up as
`^@`.
2024-06-02 09:54:15 +02:00
138a93a057 perf(lsp): avoid repeated table lookup in completion.enable 2024-06-01 10:23:01 +02:00
4c938f6d72 refactor(lsp): share completion request logic between omnifunc & trigger 2024-06-01 10:23:01 +02:00
cc1f2d2ca6 perf(lsp): don't copy completion items in filter pass 2024-06-01 10:23:01 +02:00
b2bad0ac91 feat(lsp): support postfix snippets in completion 2024-05-30 09:24:24 +02:00
0df2c6b5d0 feat(lsp): use fuzzy match on filterText instead of prefix match
The `complete()` mechanism matches completion candidates against
the typed text, so strict pre-filtering isn't necessary.

This is a first step towards supporting postfix snippets (like
`items@insert` in luals)
2024-05-30 09:24:24 +02:00
ff097f2091 feat(lsp): completion side effects 2024-05-27 14:53:28 -07:00