From: Andreas Louv Date: Wed, 12 Apr 2023 12:09:12 +0000 (+0200) Subject: Add example of "customNotificationHandlers" X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=f37a75c9151b63cf7d9cbb1d0573fbb75e810b55;p=vim-lsp.git Add example of "customNotificationHandlers" --- diff --git a/doc/lsp.txt b/doc/lsp.txt index 1a7313e..370a420 100644 --- a/doc/lsp.txt +++ b/doc/lsp.txt @@ -284,7 +284,21 @@ Aditionally the following configurations can be made: typescript-language-server) will send additional notifications which you might want to silence or handle. The provided notification handlers will be called with a - reference to the "lspserver" and the "reply". + reference to the "lspserver" and the "reply". > + + vim9script + g:LspAddServer([{ + filetype: ['javascript', 'typescript'], + path: '/usr/local/bin/typescript-language-server', + args: ['--stdio'], + customNotificationHandlers: { + '$/typescriptVersion': (lspserver, reply) => { + echom printf("TypeScript Version = %s", + reply.params.version) + } + } + }]) +< *lsp-cfg-omnicompl* omnicompl (Optional) a boolean value that enables (true) or disables (false) omni-completion for this file