]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Add option to show diagnostics in a popup
authorD4yvid <kkd4yv1d@gmail.com>
Tue, 25 Oct 2022 21:32:41 +0000 (18:32 -0300)
committerD4yvid <kkd4yv1d@gmail.com>
Tue, 25 Oct 2022 21:32:41 +0000 (18:32 -0300)
autoload/lsp/diag.vim
autoload/lsp/options.vim

index eb230d40645f0955a84e9f75b6af5ae380a0b9ad..01c56da50074482a607e76adbd0aba5ca1aeb48a 100644 (file)
@@ -201,7 +201,11 @@ export def ShowCurrentDiag(lspserver: dict<any>)
   if diag->empty()
     util.WarnMsg('No diagnostic messages found for current line')
   else
-    echo diag.message
+    if opt.lspOptions.showDiagInPopup
+      popup_atcursor(diag.message, { moved: 'any' })
+    else
+      echo diag.message
+    endif
   endif
 enddef
 
index c1895469a242e58e02bee63c4ffad403cec4109b..82bf588f7c9ec3a9fc92ecfd26f03d39ed13c412 100644 (file)
@@ -33,7 +33,9 @@ export var lspOptions: dict<any> = {
   # Show a diagnostic message on a status line
   showDiagOnStatusLine: false,
   # Don't print message when a configured language server is missing.
-  ignoreMissingServer: false
+  ignoreMissingServer: false,
+  # Make diagnostics show in a popup instead of echoing
+  showDiagInPopup: true
 }
 
 # set LSP options from user provided options