From: Andreas Louv Date: Sat, 20 May 2023 19:39:39 +0000 (+0200) Subject: Add example for how to prefix diagnostics messages X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=d011f98081e8d25436732cde3a9921755a811767;p=vim-lsp.git Add example for how to prefix diagnostics messages --- diff --git a/doc/lsp.txt b/doc/lsp.txt index 551a352..0a621b4 100644 --- a/doc/lsp.txt +++ b/doc/lsp.txt @@ -341,6 +341,22 @@ Additionally the following configurations can be made: }) }, }]) +< + And this example will prefix the diagnostic message with + the string "TypeScript: ": > + + vim9script + g:LspAddServer([{ + filetype: ['javascript', 'typescript'], + path: '/usr/local/bin/typescript-language-server', + args: ['--stdio'], + processDiagHandler: (diags: list>) => { + return diags->map((diag, ix) => { + diag.message = $'TypeScript: {diag.message}' + return diag + }) + }, + }]) < *lsp-cfg-syncInit* syncInit (Optional) for language servers (e.g. rust analyzer,