autoload/lsp/handlers.vim | 14 +++++++------- diff --git a/autoload/lsp/handlers.vim b/autoload/lsp/handlers.vim index 89b8ddf6ce3c05f9325dabbd29f64bda75f0d284..59abfb6b56060011bd46a11d6a7a151cc1f61dfe 100644 --- a/autoload/lsp/handlers.vim +++ b/autoload/lsp/handlers.vim @@ -133,14 +133,14 @@ # the LSP server # Result: Location | Location[] | LocationLink[] | null def ProcessDefDeclReply(lspserver: dict, req: dict, reply: dict): void var location: dict - if reply.result->type() == v:t_list - if !reply.result->empty() - location = reply.result[0] - else - location = {} - endif - else + if reply.result->type() == v:t_list && !reply.result->empty() && reply.result[0]->type() == v:t_dict + location = reply.result[0] + elseif reply.result->type() == v:t_dict + # not sure if there possible 'dict' type of 'result' but just in case location = reply.result + else + # cannot assign 'null' to 'location' and/so all else cases assign '{}' + location = {} endif symbol.GotoSymbol(lspserver, location, req.method)