]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Use location list instead of quickfix list
authorYegappan Lakshmanan <yegappan@yahoo.com>
Wed, 20 Jan 2021 19:45:15 +0000 (11:45 -0800)
committerYegappan Lakshmanan <yegappan@yahoo.com>
Wed, 20 Jan 2021 19:45:15 +0000 (11:45 -0800)
README.md
autoload/handlers.vim
autoload/lsp.vim
doc/lsp.txt

index 38a9b2d8493e427c855ab371a6d1d09df38388d9..5620e139577ff8733de62809f814d13925d378fb 100644 (file)
--- a/README.md
+++ b/README.md
@@ -60,12 +60,12 @@ Command|Description
 :LspGotoTypeDef|Go to the type definition of the keyword under cursor
 :LspGotoImpl|Go to the implementation of the keyword under cursor
 :LspShowSignature|Display the signature of the keyword under cursor
-:LspDiagShow|Display the diagnostics messages from the LSP server for the current buffer
+:LspDiagShow|Display the diagnostics messages from the LSP server for the current buffer in a new location list.
 :LspDiagFirst|Display the first diagnostic message for the current buffer
 :LspDiagNext|Display the next diagnostic message after the current line
 :LspDiagPrev|Display the previous diagnostic message before the current line
 :LspDiagCurrent|Display the diagnostic message for the current line
-:LspShowReferences|Display the list of references to the keyword under cursor in a new quickfix list.
+:LspShowReferences|Display the list of references to the keyword under cursor in a new location list.
 :LspHighlight|Highlight all the matches for the keyword under cursor
 :LspHighlightClear|Clear all the matches highlighted by :LspHighlight
 :LspOutline|Show the list of symbols defined in the current file in a separate window.
index ec266c760ba8bcc6966bc0a886063586a6fd906b..7d3e210d872543a571d26fe076fb50b051260f09 100644 (file)
@@ -266,9 +266,9 @@ def s:processReferencesReply(lspserver: dict<any>, req: dict<any>, reply: dict<a
                        col: GetLineByteFromPos(bnr, loc.range.start) + 1,
                        text: text})
   endfor
-  setqflist([], ' ', {title: 'Language Server', items: qflist})
+  setloclist(0, [], ' ', {title: 'Symbol Reference', items: qflist})
   var save_winid = win_getid()
-  copen
+  :lopen
   save_winid->win_gotoid()
 enddef
 
index 2b6d621f66e35190dfb3dac1d07173a52b3bc6ed..4094178de364444cf959aaea7157e6905facbe73 100644 (file)
@@ -215,7 +215,8 @@ def g:LspDiagExpr(): string
     return ''
   endif
 
-  var diagInfo: dict<any> = lspserver.getDiagByLine(v:beval_bufnr, v:beval_lnum)
+  var diagInfo: dict<any> = lspserver.getDiagByLine(v:beval_bufnr,
+                                                               v:beval_lnum)
   if diagInfo->empty()
     # No diagnostic for the current cursor location
     return ''
@@ -421,8 +422,9 @@ def lsp#showDiagnostics(): void
                    'text': text,
                    'type': s:lspDiagSevToQfType(diag.severity)})
   endfor
-  setqflist([], ' ', {'title': 'Language Server Diagnostics', 'items': qflist})
-  :copen
+  setloclist(0, [], ' ', {'title': 'Language Server Diagnostics',
+                                                       'items': qflist})
+  :lopen
 enddef
 
 # Show the diagnostic message for the current line
index 24acb68e08bbf19751765eb3ec7b9f53bed2d97a..0dd85b643ea63f20ca82026568abf6ef14deae5a 100644 (file)
@@ -2,7 +2,7 @@
 
 Author: Yegappan Lakshmanan  (yegappan AT yahoo DOT com)
 For Vim version 8.2.2342 and above
-Last change: Jan 17, 2021
+Last change: Jan 20, 2021
 
 ==============================================================================
                                                *lsp-license*
@@ -75,7 +75,7 @@ The following commands are provided:
 :LspGotoImpl           Go to the implementation of the symbol under cursor
 :LspShowSignature      Display the signature of the symbol under cursor.
 :LspDiagShow           Display the diagnostics messages from the LSP server
-                       for the current buffer in a quickfix list.
+                       for the current buffer in a location list.
 :LspDiagFirst          Jump to the first diagnostic message for the current
                        buffer.
 :LspDiagNext           Jump to the next diagnostic message for the current
@@ -84,7 +84,7 @@ The following commands are provided:
                        buffer before the current line.
 :LspDiagCurrent                Display the diagnostic message for the current line.
 :LspShowReferences     Display the list of references to the keyword under
-                       cursor in a new quickfix list.
+                       cursor in a new location list.
 :LspHighlight          Highlight all the matches for the keyword under cursor
 :LspHighlightClear     Clear all the matches highlighted by :LspHighlight
 :LspOutline            Show the list of symbols defined in the current file
@@ -214,10 +214,10 @@ accepts a list of LSP servers with the above information.
                        opening parenthesis).
 
                                                |:LspDiagShow|
-:LspDiagShow           Creates a new quickfix list with the diagnostics
+:LspDiagShow           Creates a new location list with the diagnostics
                        messages (if any) from the LSP server for the current
-                       file and opens the quickfix window. You can use the
-                       Vim quickfix commands to browse the list.
+                       file and opens the location list window. You can use
+                       the Vim location list commands to browse the list.
 
                                                |:LspDiagFirst|
 :LspDiagFirst          Jumps to the location of the first diagnostic message
@@ -236,9 +236,9 @@ accepts a list of LSP servers with the above information.
                        current line.
 
                                                |:LspShowReferences|
-:LspShowReferences     Creates a new quickfix list with the list of locations
+:LspShowReferences     Creates a new location list with the list of locations
                        where the symbol under the cursor is referenced and
-                       opens the quickfix window.
+                       opens the location window.
 
                                                |:LspHighlight|
 :LspHighlight          Highlights all the matches for the symbol under