From d011f98081e8d25436732cde3a9921755a811767 Mon Sep 17 00:00:00 2001 From: Andreas Louv Date: Sat, 20 May 2023 21:39:39 +0200 Subject: [PATCH] Add example for how to prefix diagnostics messages --- doc/lsp.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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, -- 2.48.1