mirror of
https://github.com/neovim/neovim.git
synced 2026-04-24 00:05:36 +00:00
refactor(lsp): unify capability checks and registration #36781
Problem: Our LSP type system didnt have a concept of RegistrationMethods, this is where the method to dynamically register for a capability is sent to a different method endpoint then is used to call it. Eg `textDocument/semanticTokens` rather than the specific full/range/delta methods Solution: Extended generator to create `vim.lsp.protocol.Methods.Registration` with these registration methods. Also extend `_request_name_to_client_capability` to cover these methods. Adjust typing to suit
This commit is contained in:
@@ -1149,6 +1149,12 @@ protocol.Methods = {
|
||||
workspace_workspaceFolders = 'workspace/workspaceFolders',
|
||||
}
|
||||
|
||||
-- Generated by gen_lsp.lua, keep at end of file.
|
||||
--- LSP registration methods
|
||||
---@alias vim.lsp.protocol.Method.Registration
|
||||
--- | 'notebookDocument/sync'
|
||||
--- | 'textDocument/semanticTokens'
|
||||
|
||||
-- stylua: ignore start
|
||||
-- Generated by gen_lsp.lua, keep at end of file.
|
||||
--- Maps method names to the required client capability
|
||||
@@ -1290,6 +1296,7 @@ protocol._request_name_to_server_capability = {
|
||||
['workspace/willDeleteFiles'] = { 'workspace', 'fileOperations', 'willDelete' },
|
||||
['workspace/willRenameFiles'] = { 'workspace', 'fileOperations', 'willRename' },
|
||||
['workspace/workspaceFolders'] = { 'workspace', 'workspaceFolders' },
|
||||
['textDocument/semanticTokens'] = { 'semanticTokensProvider' },
|
||||
}
|
||||
-- stylua: ignore end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user