Open k-86 opened 2 months ago
Reproduced. But I don't know what fix is correct.
Timeout error was resolved by inserting vim sleep command.
bufnr: opts.bufnr ?? await fn.bufnr(denops),
},
);
await denops.cmd("sleep 500m");
const resolvedData = await deadline(waiter.promise, opts.timeout);
const { response: { result } } = u.ensure(
However, it failed the validation check.
It is caused by the difference in the format of the returned object depending on opts.sync
.
It should be unified.
lspEngine === "nvim-lsp" && opt.sync === true
return: { result: { label: ... // expected return: { label: ...
lspEngine === "nvim-lsp" && opt.sync === false
return: { isIncomplete : false, items: [{ label: ...
lspEngine === "vim-lsp"
return: { label: ...
return: { isIncomplete : false, items: [{ label: ...
I don't reproduce the timeout error unfortunately, but lsp#send_request()
does not return...
Please test the latest plugins and Vim again.
I updated the plugins, Vim, and "How to reproduce the problem", and tested. No timeout error occurred, but it failed the validation check.
path_to_test_ts
in init.vim/vimrcIdentifier expected.
is displayed on the screendenops#plugin#is_loaded("ddc")
returns 1I don't reproduce your error but the error message is displayed.
[denops] Error: Failed to call denops#api#eval("lsp#send_request(l:server, extend(l:request,{'on_notification': {data -> denops#notify(l:name, l:id, [data])}})
)", {"server":"deno","request":{"method":"completionItem/resolve","params":{"label":"at","commitCharacters":[".",",",";"],"data":{"tsc":{"specifier":"file:///h
ome/shougo/work/test.ts","name":"at","position":3,"useCodeSnippet":true}},"sortText":"11","kind":2}},"name":"ddc","id":"lambda:ddc:1bfebdd2-4f95-4d3f-8e8c-b5f8
34e9df8f","bufnr":1}): Vim(echomsg):E121: Undefined variable: request
[denops] function Test[40]..ddc#get_previewer[1]..ddc#denops#_request[1]..denops#request[1]..denops#_internal#server#chan#request[6]..denops#_internal#rpc#vim#
request[1]..denops#api#vim#call[2]..denops#api#eval[2]..lsp#send_request, line 1
[denops] at Vim.call (file:///home/shougo/work/denops.vim/denops/@denops-private/host/vim.ts:56:13)
[denops] at eventLoopTick (ext:core/01_core.js:168:7)
[denops] at async request (file:///home/shougo/work/ddc-source-lsp/denops/ddc-source-lsp/request.ts:53:7)
[denops] at async Source.#resolve (file:///home/shougo/work/ddc-source-lsp/denops/@ddc-sources/lsp.ts:256:24)
[denops] at async Source.getPreviewer (file:///home/shougo/work/ddc-source-lsp/denops/@ddc-sources/lsp.ts:284:21)
[denops] at async getPreviewer (file:///home/shougo/work/ddc.vim/denops/ddc/ext.ts:218:21)
[denops] at async Object.getPreviewer (file:///home/shougo/work/ddc.vim/denops/ddc/app.ts:150:14)
[denops] at async Plugin.call (file:///home/shougo/work/denops.vim/denops/@denops-private/service.ts:158:12)
[denops] at async Service.#dispatch (file:///home/shougo/work/denops.vim/denops/@denops-private/service.ts:88:12)
[denops] at async Service.dispatch (file:///home/shougo/work/denops.vim/denops/@denops-private/service.ts:93:14)
[denops] Error: Unsupported method: completionItem/resolve
[denops] at request (file:///home/shougo/work/ddc-source-lsp/denops/ddc-source-lsp/request.ts:76:15)
[denops] at eventLoopTick (ext:core/01_core.js:168:7)
[denops] at async Source.#resolve (file:///home/shougo/work/ddc-source-lsp/denops/@ddc-sources/lsp.ts:256:24)
[denops] at async Source.getPreviewer (file:///home/shougo/work/ddc-source-lsp/denops/@ddc-sources/lsp.ts:284:21)
[denops] at async getPreviewer (file:///home/shougo/work/ddc.vim/denops/ddc/ext.ts:218:21)
[denops] at async Object.getPreviewer (file:///home/shougo/work/ddc.vim/denops/ddc/app.ts:150:14)
[denops] at async Plugin.call (file:///home/shougo/work/denops.vim/denops/@denops-private/service.ts:158:12)
[denops] at async Service.#dispatch (file:///home/shougo/work/denops.vim/denops/@denops-private/service.ts:88:12)
[denops] at async Service.dispatch (file:///home/shougo/work/denops.vim/denops/@denops-private/service.ts:93:14)
[denops] at async Vim.#dispatch (file:///home/shougo/work/denops.vim/denops/@denops-private/host/vim.ts:114:14)
ddc#get_previewer: {'kind': 'markdown', 'contents': []}
Elapsed time: 0.125625
Press ENTER or type command to continue
I've tried various things such as rebuilding the environment, updating Vim and the plugins, and testing with gVim, but I could not reproduce your error.
Since I'm getting nowhere, should I create a pull request for the ddc-source-lsp
that works in my environment?
Or should I create a new init.vim/vimrc
with pum.vim
preview enabled, a How to reproduce the problem
, and the solution to the problem?
Since I'm getting nowhere, should I create a pull request for the ddc-source-lsp that works in my environment?
OK. Please create it. I will test it later.
OK. Please create it. I will test it later.
OK. I'll create some PRs because there are a few things to fix.
Problems summary
When calling
ddc#get_previewer({item})
while configuringlspEngine: 'vim-lsp'
,getPreviewer
does not work due to timeout.Expected
It gets additional information for a given completion item.
Environment Information
deno -V
output): deno 1.43.2neovim/Vim
:version
output: NVIM v0.9.5 Build type: Release LuaJIT 2.1.1692716794VIM - Vi IMproved 9.1 Included patches: 1-401
Compiled by asdf Huge version without GUI. Features included (+) or not (-): +acl +file_in_path +mouse_urxvt -tag_any_white +arabic +find_in_path +mouse_xterm -tcl +autocmd +float +multi_byte +termguicolors +autochdir +folding +multi_lang +terminal -autoservername -footer -mzscheme +terminfo -balloon_eval +fork() +netbeans_intg +termresponse +balloon_eval_term +gettext +num64 +textobjects -browse -hangul_input +packages +textprop ++builtin_terms +iconv +path_extra +timers +byte_offset +insert_expand -perl +title +channel +ipv6 +persistent_undo -toolbar +cindent +job +popupwin +user_commands -clientserver +jumplist +postscript +vartabs -clipboard +keymap +printer +vertsplit +cmdline_compl +lambda +profile +vim9script +cmdline_hist +langmap -python +viminfo +cmdline_info +libcall -python3 +virtualedit +comments +linebreak +quickfix +visual +conceal +lispindent +reltime +visualextra +cryptv +listcmds +rightleft +vreplace +cscope +localmap -ruby +wildignore +cursorbind -lua +scrollbind +wildmenu +cursorshape +menu +signs +windows +dialog_con +mksession +smartindent +writebackup +diff +modify_fname -sodium -X11 +digraphs +mouse -sound +xattr -dnd -mouseshape +spell -xfontset -ebcdic +mouse_dec +startuptime -xim +emacs_tags +mouse_gpm +statusline -xpm +eval -mouse_jsbterm -sun_workshop -xsmp +ex_extra +mouse_netterm +syntax -xterm_clipboard +extra_search +mouse_sgr +tag_binary -xterm_save -farsi -mouse_sysmouse -tag_old_staticProvide a minimal init.vim/vimrc without plugin managers (Required!)
How to reproduce the problem from neovim/Vim startup (Required!)
path_to_test_ts
in init.vim/vimrcUpload the log messages by :redir and :message (if errored)
Note
Where timeout error occurs is https://github.com/Shougo/ddc-source-lsp/blob/395828936c153a628c1d4c669c878ef062f892a0/denops/%40ddc-sources/lsp.ts#L255-L270
debug code
https://github.com/Shougo/ddc-source-lsp/blob/395828936c153a628c1d4c669c878ef062f892a0/denops/%40ddc-sources/lsp.ts#L267-L270 ``` return result as LSP.CompletionItem; } catch (e) { console.log(e); return lspItem; } ``` https://github.com/Shougo/ddc-source-lsp/blob/395828936c153a628c1d4c669c878ef062f892a0/denops/ddc-source-lsp/request.ts#L47-L51 ``` const id = register( denops, (res: unknown) => { console.log(res); waiter.resolve(res); }, { once: true }, ); ``` :message ``` [denops] Error: No response from server deno [denops] at request (file:///path/to/github.com/Shougo/ddc-source-lsp/denops/ddc-source-lsp/request.ts:75:15) [denops] at eventLoopTick (ext:core/01_core.js:207:9) [denops] at async Source.#resolve (file:///path/to/github.com/Shougo/ddc-source-lsp/denops/@ddc-sources/lsp.ts:256:24) [denops] at async Source.getPreviewer (file:///path/to/github.com/Shougo/ddc-source-lsp/denops/@ddc-sources/lsp.ts:284:21) [denops] at async getPreviewer (file:///path/to/github.com/Shougo/ddc.vim/denops/ddc/ext.ts:218:21) [denops] at async Object.getPreviewer (file:///path/to/github.com/Shougo/ddc.vim/denops/ddc/app.ts:142:14) [denops] at async Plugin.call (file:///path/to/github.com/vim-denops/denops.vim/denops/@denops-private/service.ts:138:12) [denops] at async Service.#dispatch (file:///path/to/github.com/vim-denops/denops.vim/denops/@denops-private/service.ts:68:12) [denops] at async Service.dispatch (file:///path/to/github.com/vim-denops/denops.vim/denops/@denops-private/service.ts:73:14) [denops] at async Vim.#dispatch (file:///path/to/github.com/vim-denops/denops.vim/denops/@denops-private/host/vim.ts:114:14) ddc#get_previewer: {'kind': 'markdown', 'contents': []} Elapsed time: 1.074064 [denops] {"response":{"id":5,"jsonrpc":"2.0","result":{"label":"at","insertText":"at(${1:index})","sortText":"11","kind":2,"insertTextFormat":2,"documentation":{"kind":"markdown","value":"Returns the item located at the specified index.\n\n*@param* - index The zero-based index of the desired code unit. A negative index will count back from the last item."},"detail":"(method) Array