# process unsupported notification messages
def ProcessUnsupportedNotif(lspserver: dict<any>, reply: dict<any>)
- util.ErrMsg($'Unsupported notification message received from the LSP server ({lspserver.path}), message = {reply->string()}')
+ util.WarnMsg($'Unsupported notification message received from the LSP server ({lspserver.name}), message = {reply->string()}')
enddef
-# per-filetype private map inside to record if ntf once or not
-var ftypeNtfOnceMap: dict<bool> = {}
-# process unsupported notification messages but only notify once
+# Dict to process telemetry notification messages only once per filetype
+var telemetryProcessed: dict<bool> = {}
+# process unsupported notification messages only once
def ProcessUnsupportedNotifOnce(lspserver: dict<any>, reply: dict<any>)
- if !ftypeNtfOnceMap->get(&ft, v:false)
- ProcessUnsupportedNotif(lspserver, reply)
- ftypeNtfOnceMap->extend({[&ft]: v:true})
+ if !telemetryProcessed->get(&ft, false)
+ ProcessUnsupportedNotif(lspserver, reply)
+ telemetryProcessed->extend({[&ft]: true})
endif
enddef
'$/typescriptVersion',
# Dart language server sends the '$/analyzerStatus' notification which
# is not in the LSP specification.
- '$/analyzerStatus'
+ '$/analyzerStatus',
+ # pyright language server notifications
+ 'pyright/beginProgress',
+ 'pyright/reportProgress',
+ 'pyright/endProgress'
]
if lsp_notif_handlers->has_key(reply.method)
elseif lspserver.customNotificationHandlers->has_key(reply.method)
lspserver.customNotificationHandlers[reply.method](lspserver, reply)
elseif lsp_ignored_notif_handlers->index(reply.method) == -1
- util.ErrMsg($'Unsupported notification received from LSP server {reply->string()}')
+ ProcessUnsupportedNotif(lspserver, reply)
endif
enddef
elseif lspserver.customRequestHandlers->has_key(request.method)
lspserver.customRequestHandlers[request.method](lspserver, request)
elseif lspIgnoredRequestHandlers->index(request.method) == -1
- util.ErrMsg($'Unsupported request message received from the LSP server ({lspserver.path}), message = {request->string()}')
+ util.ErrMsg($'Unsupported request message received from the LSP server ({lspserver.name}), message = {request->string()}')
endif
enddef
continue
endif
# Enable omni-completion by default
- server.omnicompl = get(server, 'omnicompl', v:true)
+ server.omnicompl = server->get('omnicompl', true)
if !server.path->executable()
if !opt.lspOptions.ignoreMissingServer
endif
if !server->has_key('syncInit')
- server.syncInit = v:false
+ server.syncInit = false
endif
if !server->has_key('name') || server.name->type() != v:t_string
# Byte index points to the byte after the last byte.
return ltext->strcharlen()
else
- return ltext->charidx(byteIdx, v:false)
+ return ltext->charidx(byteIdx, false)
endif
endif
if byteIdx == ltext->strlen()
return ltext->strchars()
else
- return ltext->charidx(byteIdx, v:true)
+ return ltext->charidx(byteIdx, true)
endif
endif