diff options
author | Raphael <glephunter@gmail.com> | 2023-08-11 20:20:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-11 05:20:05 -0700 |
commit | 72e64a1afef0df1bd244bfb31dfc8619d91ff709 (patch) | |
tree | 0b82ea0a6077fcbb0a3b4dc48f9e62c0450799ff /runtime/lua/vim/treesitter/query.lua | |
parent | 3d948a4dc4b2cd3c8d3ac497caf3dfe25adfb90d (diff) | |
download | rneovim-72e64a1afef0df1bd244bfb31dfc8619d91ff709.tar.gz rneovim-72e64a1afef0df1bd244bfb31dfc8619d91ff709.tar.bz2 rneovim-72e64a1afef0df1bd244bfb31dfc8619d91ff709.zip |
fix(lsp): extra "." when completing with tsserver #24646
Problem:
With tsserver LSP, omni completion after "." inserts an extra "."
Solution:
Apply adjust_start_col() regardless of `filterText`.
adjust_start_col() is explained here:
https://github.com/neovim/neovim/blob/0ea8dfeb3dc347579753169d9e3588f6306ab703/runtime/lua/vim/lsp.lua#L2334-L2351
The `filterText` field is used in the following situations rather than as
a condition for obtaining column values:
1. Real-time filtering: When the user types characters in the editor, the
language server can use the filterText field to filter the list of
suggestions and only return suggestions that match the typed characters. This
helps to provide more precise recommendations.
2. Fuzzy matching: The filterText field can be used to perform fuzzy matching,
allowing matching in the middle or beginning of input characters, not limited
to prefix matching. This can provide a more flexible code completion
experience.
Inspecting usage of `filtertext` in vim-lsp and coc and lsp-mode:
- vim-lsp uses a `refresh_pattern` to judge filterText as completionitem word
(although I think this is not the correct usage).
- coc uses it for filtering.
Fix #22803
Diffstat (limited to 'runtime/lua/vim/treesitter/query.lua')
0 files changed, 0 insertions, 0 deletions