]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Add ID to servers
authorAndreas Louv <andreas@louv.dk>
Tue, 11 Apr 2023 14:40:02 +0000 (16:40 +0200)
committerAndreas Louv <andreas@louv.dk>
Thu, 13 Apr 2023 05:41:21 +0000 (07:41 +0200)
autoload/lsp/lspserver.vim

index 36bdd3fd2d8ece4fabf19c07c51851b55b42f63d..74e0914762e07694d849d38140afb2353fba828a 100644 (file)
@@ -1464,6 +1464,13 @@ def TagFunc(lspserver: dict<any>, pat: string, flags: string, info: dict<any>):
   return symbol.TagFunc(lspserver, taglocations, pat)
 enddef
 
+# Returns unique ID used for identifying the various servers
+var UniqueServerIdCounter = 0
+def GetUniqueServerId(): number
+  UniqueServerIdCounter = UniqueServerIdCounter + 1
+  return UniqueServerIdCounter
+enddef
+
 export def NewLspServer(name_arg: string, path_arg: string, args: list<string>,
                        isSync: bool, initializationOptions: any,
                        workspaceConfig: dict<any>,
@@ -1471,6 +1478,7 @@ export def NewLspServer(name_arg: string, path_arg: string, args: list<string>,
                        customNotificationHandlers: dict<func>,
                        debug_arg: bool): dict<any>
   var lspserver: dict<any> = {
+    id: GetUniqueServerId(),
     name: name_arg,
     path: path_arg,
     args: args,