# Process various reply messages from the LSP server
export def ProcessReply(lspserver: dict<any>, req: dict<any>, reply: dict<any>): void
- util.ErrMsg($'Error: Unsupported reply received from LSP server: {reply->string()} for request: {req->string()}')
+ util.ErrMsg($'Unsupported reply received from LSP server: {reply->string()} for request: {req->string()}')
enddef
# process a diagnostic notification message from the LSP server
# process unsupported notification messages
def ProcessUnsupportedNotif(lspserver: dict<any>, reply: dict<any>)
- util.ErrMsg($'Error: Unsupported notification message received from the LSP server ({lspserver.path}), message = {reply->string()}')
+ util.ErrMsg($'Unsupported notification message received from the LSP server ({lspserver.path}), message = {reply->string()}')
enddef
# per-filetype private map inside to record if ntf once or not
elseif lspserver.customNotificationHandlers->has_key(reply.method)
lspserver.customNotificationHandlers[reply.method](lspserver, reply)
elseif lsp_ignored_notif_handlers->index(reply.method) == -1
- util.ErrMsg($'Error: Unsupported notification received from LSP server {reply->string()}')
+ util.ErrMsg($'Unsupported notification received from LSP server {reply->string()}')
endif
enddef
enddef
def ProcessUnsupportedReq(lspserver: dict<any>, request: dict<any>)
- util.ErrMsg($'Error: Unsupported request message received from the LSP server ({lspserver.path}), message = {request->string()}')
+ util.ErrMsg($'Unsupported request message received from the LSP server ({lspserver.path}), message = {request->string()}')
enddef
# process a request message from the server
if lspRequestHandlers->has_key(request.method)
lspRequestHandlers[request.method](lspserver, request)
else
- util.ErrMsg($'Error: Unsupported request message received from the LSP server ({lspserver.path}), message = {request->string()}')
+ util.ErrMsg($'Unsupported request message received from the LSP server ({lspserver.path}), message = {request->string()}')
endif
enddef
if msg.error->has_key('data')
emsg ..= $', data = {msg.error.data->string()}'
endif
- util.ErrMsg($'Error(LSP): request {req.method} failed ({emsg})')
+ util.ErrMsg($'request {req.method} failed ({emsg})')
endif
endif
elseif msg->has_key('id') && msg->has_key('method')
# notification message from the server
lspserver.processNotif(msg)
else
- util.ErrMsg($'Error(LSP): Unsupported message ({msg->string()})')
+ util.ErrMsg($'Unsupported message ({msg->string()})')
endif
enddef
# Enable/disable the logging of the language server protocol messages
def ServerDebug(arg: string)
if ['errors', 'messages', 'off', 'on']->index(arg) == -1
- util.ErrMsg($'Error: Unsupported argument "{arg}" for LspServer debug')
+ util.ErrMsg($'Unsupported argument "{arg}" for LspServer debug')
return
endif
lines->extend(lspserver.getMessages())
endfor
else
- util.ErrMsg($'Error: Unsupported argument "{arg}"')
+ util.ErrMsg($'Unsupported argument "{arg}"')
return
endif
export def AddServer(serverList: list<dict<any>>)
for server in serverList
if !server->has_key('filetype') || !server->has_key('path')
- util.ErrMsg('Error: LSP server information is missing filetype or path')
+ util.ErrMsg('LSP server information is missing filetype or path')
continue
endif
# Enable omni-completion by default
if !server.path->executable()
if !opt.lspOptions.ignoreMissingServer
- util.ErrMsg($'Error: LSP server {server.path} is not found')
+ util.ErrMsg($'LSP server {server.path} is not found')
endif
return
endif
var args: list<string> = []
if server->has_key('args')
if server.args->type() != v:t_list
- util.ErrMsg($'Error: Arguments for LSP server {server.args} is not a List')
+ util.ErrMsg($'Arguments for LSP server {server.args} is not a List')
return
endif
args = server.args
endif
if server.omnicompl->type() != v:t_bool
- util.ErrMsg($'Error: Setting of omnicompl {server.omnicompl} is not a Boolean')
+ util.ErrMsg($'Setting of omnicompl {server.omnicompl} is not a Boolean')
return
endif
AddServerForFiltype(lspserver, ftype, server.omnicompl)
endfor
else
- util.ErrMsg($'Error: Unsupported file type information "{ftypes->string()}" in LSP server registration')
+ util.ErrMsg($'Unsupported file type information "{ftypes->string()}" in LSP server registration')
continue
endif
endfor
# Params: SetTraceParams
def ServerTraceSet(traceVal: string)
if ['off', 'messages', 'verbose']->index(traceVal) == -1
- util.ErrMsg($'Error: Unsupported LSP server trace value {traceVal}')
+ util.ErrMsg($'Unsupported LSP server trace value {traceVal}')
return
endif
# Format the entire file
export def TextDocFormat(range_args: number, line1: number, line2: number)
if !&modifiable
- util.ErrMsg('Error: Current file is not a modifiable file')
+ util.ErrMsg('Current file is not a modifiable file')
return
endif
endif
:redraw!
if !dirName->isdirectory()
- util.ErrMsg($'Error: {dirName} is not a directory')
+ util.ErrMsg($'{dirName} is not a directory')
return
endif
endif
:redraw!
if !dirName->isdirectory()
- util.ErrMsg($'Error: {dirName} is not a directory')
+ util.ErrMsg($'{dirName} is not a directory')
return
endif
endif
if &foldmethod != 'manual'
- util.ErrMsg("Error: Only works when 'foldmethod' is 'manual'")
+ util.ErrMsg("Only works when 'foldmethod' is 'manual'")
return
endif
var subcmd = args[6 : ]->trim()
ServerTraceSet(subcmd)
else
- util.ErrMsg($'Error: LspServer - Unsupported argument "{args}"')
+ util.ErrMsg($'LspServer - Unsupported argument "{args}"')
endif
enddef
var job = cmd->job_start(opts)
if job->job_status() == 'fail'
- util.ErrMsg($'Error: Failed to start LSP server {lspserver.path}')
+ util.ErrMsg($'Failed to start LSP server {lspserver.path}')
return 1
endif
&& (request.id->trim() =~ '[^[:digit:]]\+'
|| request.id->trim() == ''))
|| (request.id->type() != v:t_string && request.id->type() != v:t_number)
- util.ErrMsg('Error: request.id of response to LSP server is not a correct number')
+ util.ErrMsg('request.id of response to LSP server is not a correct number')
return
endif
var resp: dict<any> = lspserver.createResponse(
if reply.error->has_key('data')
emsg ..= $', data = {reply.error.data->string()}'
endif
- util.ErrMsg($'Error(LSP): request {method} failed ({emsg})')
+ util.ErrMsg($'request {method} failed ({emsg})')
endif
return {}
if reply.error->has_key('data')
emsg ..= $', data = {reply.error.data->string()}'
endif
- util.ErrMsg($'Error(LSP): request {method} failed ({emsg})')
+ util.ErrMsg($'request {method} failed ({emsg})')
return
endif
if !reply->has_key('result')
- util.ErrMsg($'Error(LSP): request {method} failed (no result)')
+ util.ErrMsg($'request {method} failed (no result)')
return
endif
def GetCompletion(lspserver: dict<any>, triggerKind_arg: number, triggerChar: string): void
# Check whether LSP server supports completion
if !lspserver.isCompletionProvider
- util.ErrMsg('Error: LSP server does not support completion')
+ util.ErrMsg('LSP server does not support completion')
return
endif
def ResolveCompletion(lspserver: dict<any>, item: dict<any>): void
# Check whether LSP server supports completion item resolve
if !lspserver.isCompletionResolveProvider
- util.ErrMsg('Error: LSP server does not support completion item resolve')
+ util.ErrMsg('LSP server does not support completion item resolve')
return
endif
if reply->empty() || reply.result->empty()
var emsg: string
if msg ==# 'textDocument/declaration'
- emsg = 'Error: symbol declaration is not found'
+ emsg = 'symbol declaration is not found'
elseif msg ==# 'textDocument/typeDefinition'
- emsg = 'Error: symbol type definition is not found'
+ emsg = 'symbol type definition is not found'
elseif msg ==# 'textDocument/implementation'
- emsg = 'Error: symbol implementation is not found'
+ emsg = 'symbol implementation is not found'
else
- emsg = 'Error: symbol definition is not found'
+ emsg = 'symbol definition is not found'
endif
util.WarnMsg(emsg)
def GotoDefinition(lspserver: dict<any>, peek: bool, cmdmods: string)
# Check whether LSP server supports jumping to a definition
if !lspserver.isDefinitionProvider
- util.ErrMsg('Error: Jumping to a symbol definition is not supported')
+ util.ErrMsg('Jumping to a symbol definition is not supported')
return
endif
def GotoDeclaration(lspserver: dict<any>, peek: bool, cmdmods: string)
# Check whether LSP server supports jumping to a declaration
if !lspserver.isDeclarationProvider
- util.ErrMsg('Error: Jumping to a symbol declaration is not supported')
+ util.ErrMsg('Jumping to a symbol declaration is not supported')
return
endif
def GotoTypeDef(lspserver: dict<any>, peek: bool, cmdmods: string)
# Check whether LSP server supports jumping to a type definition
if !lspserver.isTypeDefinitionProvider
- util.ErrMsg('Error: Jumping to a symbol type definition is not supported')
+ util.ErrMsg('Jumping to a symbol type definition is not supported')
return
endif
def GotoImplementation(lspserver: dict<any>, peek: bool, cmdmods: string)
# Check whether LSP server supports jumping to a implementation
if !lspserver.isImplementationProvider
- util.ErrMsg('Error: Jumping to a symbol implementation is not supported')
+ util.ErrMsg('Jumping to a symbol implementation is not supported')
return
endif
param.uri = util.LspFileToUri(@%)
var reply = lspserver.rpc('textDocument/switchSourceHeader', param)
if reply->empty() || reply.result->empty()
- util.WarnMsg('Error: No alternate file found')
+ util.WarnMsg('No alternate file found')
return
endif
def ShowSignature(lspserver: dict<any>): void
# Check whether LSP server supports signature help
if !lspserver.isSignatureHelpProvider
- util.ErrMsg('Error: LSP server does not support signature help')
+ util.ErrMsg('LSP server does not support signature help')
return
endif
def ShowReferences(lspserver: dict<any>, peek: bool): void
# Check whether LSP server supports getting reference information
if !lspserver.isReferencesProvider
- util.ErrMsg('Error: LSP server does not support showing references')
+ util.ErrMsg('LSP server does not support showing references')
return
endif
# Result: Location[] | null
if reply->empty() || reply.result->empty()
- util.WarnMsg('Error: No references found')
+ util.WarnMsg('No references found')
return
endif
def DocHighlight(lspserver: dict<any>, cmdmods: string): void
# Check whether LSP server supports getting highlight information
if !lspserver.isDocumentHighlightProvider
- util.ErrMsg('Error: LSP server does not support document highlight')
+ util.ErrMsg('LSP server does not support document highlight')
return
endif
def GetDocSymbols(lspserver: dict<any>, fname: string): void
# Check whether LSP server supports getting document symbol information
if !lspserver.isDocumentSymbolProvider
- util.ErrMsg('Error: LSP server does not support getting list of symbols')
+ util.ErrMsg('LSP server does not support getting list of symbols')
return
endif
start_lnum: number, end_lnum: number)
# Check whether LSP server supports formatting documents
if !lspserver.isDocumentFormattingProvider
- util.ErrMsg('Error: LSP server does not support formatting documents')
+ util.ErrMsg('LSP server does not support formatting documents')
return
endif
def IncomingCalls(lspserver: dict<any>, fname: string)
# Check whether LSP server supports call hierarchy
if !lspserver.isCallHierarchyProvider
- util.ErrMsg('Error: LSP server does not support call hierarchy')
+ util.ErrMsg('LSP server does not support call hierarchy')
return
endif
def OutgoingCalls(lspserver: dict<any>, fname: string)
# Check whether LSP server supports call hierarchy
if !lspserver.isCallHierarchyProvider
- util.ErrMsg('Error: LSP server does not support call hierarchy')
+ util.ErrMsg('LSP server does not support call hierarchy')
return
endif
def InlayHintsShow(lspserver: dict<any>)
# Check whether LSP server supports type hierarchy
if !lspserver.isInlayHintProvider && !lspserver.isClangdInlayHintsProvider
- util.ErrMsg('Error: LSP server does not support inlay hint')
+ util.ErrMsg('LSP server does not support inlay hint')
return
endif
def TypeHiearchy(lspserver: dict<any>, direction: number)
# Check whether LSP server supports type hierarchy
if !lspserver.isTypeHierarchyProvider
- util.ErrMsg('Error: LSP server does not support type hierarchy')
+ util.ErrMsg('LSP server does not support type hierarchy')
return
endif
def RenameSymbol(lspserver: dict<any>, newName: string)
# Check whether LSP server supports rename operation
if !lspserver.isRenameProvider
- util.ErrMsg('Error: LSP server does not support rename operation')
+ util.ErrMsg('LSP server does not support rename operation')
return
endif
line2: number, query: string)
# Check whether LSP server supports code action operation
if !lspserver.isCodeActionProvider
- util.ErrMsg('Error: LSP server does not support code action operation')
+ util.ErrMsg('LSP server does not support code action operation')
return
endif
def CodeLens(lspserver: dict<any>, fname: string)
# Check whether LSP server supports code lens operation
if !lspserver.isCodeLensProvider
- util.ErrMsg('Error: LSP server does not support code lens operation')
+ util.ErrMsg('LSP server does not support code lens operation')
return
endif
var params = {textDocument: {uri: util.LspFileToUri(fname)}}
var reply = lspserver.rpc('textDocument/codeLens', params)
if reply->empty() || reply.result->empty()
- util.WarnMsg($'Error: No code lens actions found for the current file')
+ util.WarnMsg($'No code lens actions found for the current file')
return
endif
def WorkspaceQuerySymbols(lspserver: dict<any>, query: string)
# Check whether the LSP server supports listing workspace symbols
if !lspserver.isWorkspaceSymbolProvider
- util.ErrMsg('Error: LSP server does not support listing workspace symbols')
+ util.ErrMsg('LSP server does not support listing workspace symbols')
return
endif
param.query = query
var reply = lspserver.rpc('workspace/symbol', param)
if reply->empty() || reply.result->empty()
- util.WarnMsg($'Error: Symbol "{query}" is not found')
+ util.WarnMsg($'Symbol "{query}" is not found')
return
endif
|| !lspserver.caps.workspace->has_key('workspaceFolders')
|| !lspserver.caps.workspace.workspaceFolders->has_key('supported')
|| !lspserver.caps.workspace.workspaceFolders.supported
- util.ErrMsg('Error: LSP server does not support workspace folders')
+ util.ErrMsg('LSP server does not support workspace folders')
return
endif
if lspserver.workspaceFolders->index(dirName) != -1
- util.ErrMsg($'Error: {dirName} is already part of this workspace')
+ util.ErrMsg($'{dirName} is already part of this workspace')
return
endif
|| !lspserver.caps.workspace->has_key('workspaceFolders')
|| !lspserver.caps.workspace.workspaceFolders->has_key('supported')
|| !lspserver.caps.workspace.workspaceFolders.supported
- util.ErrMsg('Error: LSP server does not support workspace folders')
+ util.ErrMsg('LSP server does not support workspace folders')
return
endif
var idx: number = lspserver.workspaceFolders->index(dirName)
if idx == -1
- util.ErrMsg($'Error: {dirName} is not currently part of this workspace')
+ util.ErrMsg($'{dirName} is not currently part of this workspace')
return
endif
def SelectionRange(lspserver: dict<any>, fname: string)
# Check whether LSP server supports selection ranges
if !lspserver.isSelectionRangeProvider
- util.ErrMsg('Error: LSP server does not support selection ranges')
+ util.ErrMsg('LSP server does not support selection ranges')
return
endif
def SelectionExpand(lspserver: dict<any>)
# Check whether LSP server supports selection ranges
if !lspserver.isSelectionRangeProvider
- util.ErrMsg('Error: LSP server does not support selection ranges')
+ util.ErrMsg('LSP server does not support selection ranges')
return
endif
def SelectionShrink(lspserver: dict<any>)
# Check whether LSP server supports selection ranges
if !lspserver.isSelectionRangeProvider
- util.ErrMsg('Error: LSP server does not support selection ranges')
+ util.ErrMsg('LSP server does not support selection ranges')
return
endif
def FoldRange(lspserver: dict<any>, fname: string)
# Check whether LSP server supports fold ranges
if !lspserver.isFoldingRangeProvider
- util.ErrMsg('Error: LSP server does not support folding')
+ util.ErrMsg('LSP server does not support folding')
return
endif