Files
neovim/runtime/doc
Yi Ming 8d5452c46d refactor(lsp): stateful data abstraction, vim.lsp.Capability #34639
Problem:
Closes #31453

Solution:
Introduce `vim.lsp.Capability`, which may serve as the base class for
all LSP features that require caching data. it
- was created if there is at least one client that supports the specific method;
- was destroyed if all clients that support the method were detached.

- Apply the refactor for `folding_range.lua` and `semantic_tokens.lua`.
- Show active features in :checkhealth.

Future:
I found that these features that are expected to be refactored by
`vim.lsp.Capability` have one characteristic in common: they all send
LSP requests once the document is modified. The following code is
different, but they are all for this purpose.

- semantic tokens:
fb8dba413f/runtime/lua/vim/lsp/semantic_tokens.lua (L192-L198)
- inlay hints, folding ranges, document color
fb8dba413f/runtime/lua/vim/lsp/inlay_hint.lua (L250-L266)

I think I can sum up this characteristic as the need to keep certain
data synchronized with the latest version computed by the server.
I believe we can handle this at the `vim.lsp.Capability` level, and
I think it will be very useful.

Therefore, my next step is to implement LSP request sending and data
synchronization on `vim.lsp.Capability`, rather than limiting it to the
current create/destroy data approach.
2025-07-07 03:51:30 +00:00
..
2025-07-01 12:57:37 +01:00
2023-07-25 05:07:13 -07:00
2025-06-18 12:13:55 +02:00
2025-05-03 10:08:53 -07:00
2025-06-18 12:12:23 +02:00
2024-05-15 23:19:26 +02:00
2025-04-27 15:44:11 -07:00
2025-06-14 17:24:36 +02:00
2025-05-03 10:08:53 -07:00
2023-06-25 17:14:28 +02:00
2025-06-10 23:00:38 +08:00
2025-05-03 10:08:53 -07:00
2025-06-18 06:19:00 -07:00
2025-06-14 17:24:36 +02:00
2025-05-03 10:08:53 -07:00
2022-10-14 08:01:13 -07:00
2025-06-18 12:13:55 +02:00
2025-03-30 13:29:36 -07:00
2025-06-01 14:13:50 -07:00
2024-11-21 06:50:30 +08:00
2025-05-03 15:47:59 -07:00
2025-06-18 12:12:23 +02:00
2024-01-18 00:14:48 -08:00
2025-06-18 12:12:23 +02:00
2023-01-01 15:05:13 +01:00
2025-03-15 15:00:44 +01:00
2025-04-27 13:40:46 -07:00
2025-02-15 14:55:25 +01:00
2025-06-18 12:12:23 +02:00
2025-05-03 15:47:59 -07:00
2025-03-18 06:18:37 -07:00
2023-08-10 17:28:02 +08:00
2025-01-03 08:29:36 -08:00
2024-04-23 08:20:36 +08:00
2024-05-11 18:14:03 +08:00
2023-04-23 15:22:55 +02:00
2023-01-03 10:07:43 +00:00
2023-06-25 17:14:28 +02:00
2023-06-25 17:14:28 +02:00
2021-05-01 22:29:03 -04:00
2018-10-29 10:01:44 +01:00
2023-06-25 17:14:28 +02:00
2021-04-29 20:42:16 -04:00
2023-06-26 11:29:12 +02:00
2023-07-25 05:07:13 -07:00
2025-06-18 12:12:23 +02:00
2023-06-19 08:40:33 -07:00
2025-05-03 15:47:59 -07:00
2025-03-18 06:18:37 -07:00