diff options
| author | Marcus Caisey <marcus@teckna.com> | 2026-05-21 15:51:33 +0100 |
|---|---|---|
| committer | Marcus Caisey <marcus@teckna.com> | 2026-05-21 18:22:13 +0100 |
| commit | c75365d22a11c0bea992e7e2764234f9284a5d48 (patch) | |
| tree | 6d3216400e9abb48bfe02c5121138bded2bc5a4a /runtime/syntax/cpp.vim | |
| parent | d6d03716cf8628de7d9a261e1caeb5cefeb74774 (diff) | |
| download | rneovim-c75365d22a11c0bea992e7e2764234f9284a5d48.tar.gz rneovim-c75365d22a11c0bea992e7e2764234f9284a5d48.tar.bz2 rneovim-c75365d22a11c0bea992e7e2764234f9284a5d48.zip | |
refactor(lsp): centralise complete item info generation logic
Problem:
The logic for generating the complete item `info` is spread across
`_lsp_to_complete_items`, the `CompleteChanged` event handler, and
`CompletionResolver:request`. This has previously caused the `info`
shown for resolved (via `completionItem/resolve`) and unresolved items
to differ.
Solution:
Centralise the logic in a new `complete_item_info` function which is now
solely responsible for determining:
1. The `info` to show.
2. The markup kind of the `info`.
3. Whether the `info` is complete.
This simplifies the interaction between the 3 functions mentioned in the
problem:
- `_lsp_to_complete_items` calls `complete_item_info` and passes along
the markup kind and whether the item needs resolving via the complete
item's `user_data`.
- The `CompleteChanged` consumes the markup kind and whether the
item needs resolving from the complete item's `user_data`.
- `CompletionResolver:request`, like `_lsp_to_complete_items` calls
`complete_item_info` again and updates the current `info` if it's
changed.
Diffstat (limited to 'runtime/syntax/cpp.vim')
0 files changed, 0 insertions, 0 deletions