diff options
author | Mathias Fußenegger <mfussenegger@users.noreply.github.com> | 2024-01-02 18:52:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-02 18:52:29 +0100 |
commit | 91d76ac941a26f8370c48e062b5e09f98c75f7bc (patch) | |
tree | 669a5619e5315269c94efb2502d68ae3386cade3 | |
parent | 5dc0bdfe98b59bb03226167ed541d17cc5af30b1 (diff) | |
download | rneovim-91d76ac941a26f8370c48e062b5e09f98c75f7bc.tar.gz rneovim-91d76ac941a26f8370c48e062b5e09f98c75f7bc.tar.bz2 rneovim-91d76ac941a26f8370c48e062b5e09f98c75f7bc.zip |
docs(lsp): add supports_method to vim.lsp.client docs (#26852)
-rw-r--r-- | runtime/doc/lsp.txt | 4 | ||||
-rw-r--r-- | runtime/lua/vim/lsp.lua | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index d53a7b4c11..bbf19f9569 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -745,6 +745,10 @@ client() *vim.lsp.client* client is fully stopped. • on_attach(client, bufnr) Runs the on_attach function from the client's config if it was defined. Useful for buffer-local setup. + • supports_method(method, [opts]): boolean Checks if a client supports a + given method. Always returns true for unknown off-spec methods. [opts] + is a optional `{bufnr?: integer}` table. Some language server + capabilities can be file specific. • Members • {id} (number): The id allocated to the client. diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index 3105413b53..27c5f7ce7b 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -425,6 +425,12 @@ end --- Runs the on_attach function from the client's config if it was defined. --- Useful for buffer-local setup. --- +--- - supports_method(method, [opts]): boolean +--- Checks if a client supports a given method. +--- Always returns true for unknown off-spec methods. +--- [opts] is a optional `{bufnr?: integer}` table. +--- Some language server capabilities can be file specific. +--- --- - Members --- - {id} (number): The id allocated to the client. --- |