return
endif
- if !server->has_key('sync')
- server['sync'] = v:false
+ if !server->has_key('syncInit')
+ server.syncInit = v:false
endif
var lspserver: dict<any> = lserver.NewLspServer(server.path, args,
- \ server.sync)
+ server.syncInit)
if server.filetype->type() == v:t_string
LspAddServer(server.filetype, lspserver)
req.params->extend(initparams)
lspserver.sendMessage(req)
- if lspserver.sync
+ if lspserver.syncInit
lspserver.waitForResponse(req)
endif
enddef
var lspserver: dict<any> = {
path: path,
args: args,
- sync: isSync,
+ syncInit: isSync,
running: false,
ready: false,
job: v:none,
server. Each argument is a separate List item.
omnicompl a boolean value that enables (true) or disables
(false) omni-completion for this file type.
- sync (Optional) for lsp servers that responds to a
- 'initialize'-request with a 'initialzed' response this
- should be set to 'v:true'. By default this is set to
- 'v:false'.
+ syncInit (Optional) for lsp servers (e.g. rust analyzer, gopls)
+ that take time to reply to a 'initialize' request
+ message this should be set to 'v:true'. By default
+ this is set to 'v:false'. If this is set to true,
+ then a synchronous call is used to initialize the LSP
+ server. Otherwise the server is initialized
+ asynchronously.
The LSP servers are added using the LspAddServer() function. This function
accepts a list of LSP servers with the above information.
var expected: dict<any>
expected = {id: 0, col: 8, end: 1, type: 'signature', length: 5, start: 1}
if has('patch-8.2.3233')
- expected.type_bufnr = 11
+ expected.type_bufnr = bnr
endif
assert_equal([expected], prop_list(1, {bufnr: bnr}))
popup_close(p[0])
assert_equal(['MyFunc(int a, int b) -> int'], getbufline(bnr, 1, '$'))
expected = {id: 0, col: 15, end: 1, type: 'signature', length: 5, start: 1}
if has('patch-8.2.3233')
- expected.type_bufnr = 11
+ expected.type_bufnr = bnr
endif
assert_equal([expected], prop_list(1, {bufnr: bnr}))
popup_close(p[0])