]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Don't check the capabilities for language servers which are not ready. Update help...
authorYegappan Lakshmanan <yegappan@yahoo.com>
Fri, 30 Jun 2023 04:25:36 +0000 (21:25 -0700)
committerYegappan Lakshmanan <yegappan@yahoo.com>
Fri, 30 Jun 2023 04:25:36 +0000 (21:25 -0700)
autoload/lsp/buffer.vim
autoload/lsp/lsp.vim
doc/lsp.txt

index 7c1b6c110f89b5ff0ce3ea394aabccbc9d922ff3..54c191b6661f9f2812a7f4a8d8c7c8a92b92a1ca 100644 (file)
@@ -85,7 +85,7 @@ export def BufLspServerGet(bnr: number, feature: string = null_string): dict<any
   var possibleLSPs: list<dict<any>> = []
 
   for lspserver in bufnrToServers[bnr]
-    if !SupportedCheckFn(lspserver)
+    if !lspserver.ready || !SupportedCheckFn(lspserver)
       continue
     endif
 
index 41131048ac4c49a8ed189e73b379af348d74bf61..43f96c564750a5cc5cb96f1dd77e49d9a412abce 100644 (file)
@@ -853,6 +853,16 @@ enddef
 
 # open a window and display all the symbols in a file (outline)
 export def Outline(cmdmods: string, winsize: number)
+  var fname: string = @%
+  if fname->empty()
+    return
+  endif
+
+  var lspserver: dict<any> = buf.CurbufGetServerChecked('documentSymbol')
+  if lspserver->empty() || !lspserver.running || !lspserver.ready
+    return
+  endif
+
   outline.OpenOutlineWindow(cmdmods, winsize)
   g:LspRequestDocSymbols()
 enddef
@@ -864,7 +874,7 @@ export def ShowDocSymbols()
     return
   endif
 
-  var lspserver: dict<any> = buf.CurbufGetServer('documentSymbol')
+  var lspserver: dict<any> = buf.CurbufGetServerChecked('documentSymbol')
   if lspserver->empty() || !lspserver.running || !lspserver.ready
     return
   endif
index a75277d03912434f61dceb7e8e0efc5999103e67..cec1a2366259622d175c448e1e9b614001cec0cf 100644 (file)
@@ -523,7 +523,7 @@ hideDisabledCodeActions |Boolean| option. Hide all the disabled code actions.
                        By default this is set to false.
 
                                                *lsp-opt-highlightDiagInline*
-highlightDiagInline    |Boolean| option.  Highlight the diagnostics inline
+highlightDiagInline    |Boolean| option.  Highlight the diagnostics inline.
                        By default this is set to false.
 
                                                *lsp-opt-hoverInPreview*
@@ -1256,16 +1256,34 @@ display the entire diagnostic message from the language server for the current
 line.
 
 By default, the lines with a diagnostic message have a sign placed on them and
-are highlighted.  You can temporarily disable them for the current Vim session
-using the |:LspDiagHighlightDisable| command and re-enable them using the
-|:LspDiagHighlightEnable| command.
-
-To disable the automatic placement of signs on the lines with a diagnostic
-message, you can set the 'autoHighlightDiags' option to false: >
+are highlighted.  You can disable the automatic sign placement by setting the
+"showDiagWithSign" option to v:false.  By default, this option is set to
+v:true.  The line with the diagnostics is highlighted using the "LspDiagLine"
+highlight group.
+
+You can also display the diagnostic message as a virtual text near the
+location of the diagnostics by setting the "showDiagWithVirtualText" option to
+v:true.  This needs Vim version 9.0.1157 or later.  By default this option is
+set to v:false.  The position of the virtual text is controlled by the
+"diagVirtualTextAlign" option.  By default, this is set to 'above'.  The other
+supported values are 'below' and 'after'.
+
+The range of text for a diagnostic message can be automatically highlighted by
+setting the "highlightDiagInline" option to v:true.  By default, this option
+is set to v:false.  The text is highlighted using the "LspDiagInlineError" or
+"LspDiagInlineHint" or "LspDiagInlineInfo" or "LspDiagInlineWarning" highlight
+group.
+
+You can temporarily disable the automatic diagnostic highlighting for the
+current Vim session using the |:LspDiagHighlightDisable| command and re-enable
+them using the |:LspDiagHighlightEnable| command.
+
+To disable the automatic highlighting of the diagnostics, you can set the
+'autoHighlightDiags' option to v:false: >
 
        LspOptionsSet({'autoHighlightDiags': false})
 <
-By default the 'autoHighlightDiags' option is set to true.
+By default the 'autoHighlightDiags' option is set to v:true.
 
 The function lsp#lsp#ErrorCount() function can be used to get the count of the
 diagnostic messages in the current buffer by type.  This function returns a