# process the 'initialize' method reply from the LSP server
# Result: InitializeResult
def ProcessInitializeReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>): void
- if reply.result->len() <= 0
+ if reply.result->empty()
return
endif
# process the 'textDocument/signatureHelp' reply from the LSP server
# Result: SignatureHelp | null
def ProcessSignaturehelpReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>): void
+ if reply.result->empty()
+ return
+ endif
signature.SignatureDisplay(lspserver, reply.result)
enddef
# process the 'textDocument/references' reply from the LSP server
# Result: Location[] | null
def ProcessReferencesReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>): void
+ if reply.result->empty()
+ util.WarnMsg('Error: No references found')
+ lspserver.peekSymbol = false
+ return
+ endif
+
symbol.ShowReferences(lspserver, reply.result)
enddef
# process the 'textDocument/codeAction' reply from the LSP server
# Result: (Command | CodeAction)[] | null
def ProcessCodeActionReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
+ if reply.result->empty()
+ # no action can be performed
+ util.WarnMsg('No code action is available')
+ return
+ endif
+
codeaction.ApplyCodeAction(lspserver, reply.result)
enddef
# Reply: 'textDocument/selectionRange'
# Result: SelectionRange[] | null
def ProcessSelectionRangeReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
+ if reply.result->empty()
+ return
+ endif
+
selection.SelectionStart(lspserver, reply.result)
enddef
var r: dict<dict<number>>
var symName: string
- if reply.result->type() != v:t_list
+ if reply.result->empty()
return
endif
# process the 'callHierarchy/incomingCalls' reply from the LSP server
# Result: CallHierarchyIncomingCall[] | null
def ProcessIncomingCalls(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
+ if reply.result->empty()
+ return
+ endif
+
callhier.IncomingCalls(reply.result)
enddef
# process the 'callHierarchy/outgoingCalls' reply from the LSP server
# Result: CallHierarchyOutgoingCall[] | null
def ProcessOutgoingCalls(lspserver: dict<any>, req: dict<any>, reply: dict<any>)
+ if reply.result->empty()
+ return
+ endif
+
callhier.OutgoingCalls(reply.result)
enddef