From 5b779927420c7909392c7624bd111dcc43e72496 Mon Sep 17 00:00:00 2001 From: Andreas Louv Date: Tue, 11 Apr 2023 16:40:02 +0200 Subject: [PATCH] Add ID to servers --- autoload/lsp/lspserver.vim | 8 ++++++++ 1 file changed, 8 insertions(+) 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, -- 2.48.1