]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Decode symbol location only when needed
authorYegappan Lakshmanan <yegappan@yahoo.com>
Sun, 18 Jun 2023 13:24:19 +0000 (06:24 -0700)
committerYegappan Lakshmanan <yegappan@yahoo.com>
Sun, 18 Jun 2023 13:24:19 +0000 (06:24 -0700)
autoload/lsp/lspserver.vim

index 3ef58dce10aa1679dae1368642521eb15cdda0e0..11c4afa753e16ef74fa67324b4025baf38fa04f2 100644 (file)
@@ -1451,12 +1451,15 @@ def WorkspaceQuerySymbols(lspserver: dict<any>, query: string, firstCall: bool,
 
   var symInfo: list<dict<any>> = reply.result
 
-  symInfo->map((_, sym) => {
+  if lspserver.needOffsetEncoding
+    # Decode the position encoding in all the symbol locations
+    symInfo->map((_, sym) => {
       if sym->has_key('location')
        lspserver.decodeLocation(sym.location)
       endif
       return sym
     })
+  endif
 
   if firstCall && symInfo->len() == 1
     # If there is only one symbol, then jump to the symbol location