From: Andreas Louv Date: Tue, 11 Apr 2023 14:40:02 +0000 (+0200) Subject: Add ID to servers X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=bcb80aac9eb537d5ae8fb237071f25391bd47aea;p=vim-lsp.git Add ID to servers --- diff --git a/autoload/lsp/lspserver.vim b/autoload/lsp/lspserver.vim index 36bdd3f..74e0914 100644 --- a/autoload/lsp/lspserver.vim +++ b/autoload/lsp/lspserver.vim @@ -1464,6 +1464,13 @@ def TagFunc(lspserver: dict, pat: string, flags: string, info: dict): 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, isSync: bool, initializationOptions: any, workspaceConfig: dict, @@ -1471,6 +1478,7 @@ export def NewLspServer(name_arg: string, path_arg: string, args: list, customNotificationHandlers: dict, debug_arg: bool): dict var lspserver: dict = { + id: GetUniqueServerId(), name: name_arg, path: path_arg, args: args,