Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When running CocAction('codeAction') Vim hangs for 60 seconds #5251

Open
s-leroux opened this issue Feb 1, 2025 · 0 comments
Open

When running CocAction('codeAction') Vim hangs for 60 seconds #5251

s-leroux opened this issue Feb 1, 2025 · 0 comments

Comments

@s-leroux
Copy link

s-leroux commented Feb 1, 2025

Result from CocInfo

## versions

vim version: VIM - Vi IMproved 9.0 9001499
node version: v16.15.1
coc.nvim version: 0.0.82-baac60ac 2025-01-13 11:27:36 +0800
coc.nvim directory: /home/sylvain/.vim/plugged/coc.nvim
term: tmux
platform: linux

## Log of coc.nvim

2025-02-01T19:40:49.148 DEBUG (pid:38791) [core-documents] - buffer created 1 true file:///home/sylvain/Projects/wallet-valuator/src/services/cryptoresolvers/compositecryptoresolver.mts
2025-02-01T19:40:49.151 DEBUG (pid:38791) [core-editors] - editor created winid & bufnr & tabpageid:  1000 1 1
2025-02-01T19:40:49.215 INFO (pid:38791) [plugin] - coc.nvim initialized with node: v16.15.1 after 188
2025-02-01T19:40:49.263 INFO (pid:38791) [services] - service tsserver started
2025-02-01T19:44:59.026 INFO (pid:38791) [attach] - Request action: codeAction []
2025-02-01T19:45:02.027 ERROR (pid:38791) [timing] - Request timeout after 3000ms
2025-02-01T19:50:12.806 DEBUG (pid:38791) [core-documents] - document detach 1 file:///home/sylvain/Projects/wallet-valuator/src/services/cryptoresolvers/compositecryptoresolver.mts


Describe the bug

I don't know if this is a bug or if the software was designed that way. Nevertheless, I noticed when I call CocAction('codeAction') to apply a change, the changes menu does appear, but Vim hangs for 60s. After that, I have a "timeout" error message (see screenshots below). Vim is then responsive, and I can choose and apply the code action as expected.

Interestingly, if I call CocActionAsync('codeAction'), it works as expected without a noticeable delay in the Vim reactiveness.

Can you explain that behavior? Is it a bug or not? Are there any drawbacks in using CocActionAsync vs CocAction?
Thank you for your time and the great work on CoC.nvim. It is an amazing project for Vim lovers like me!

Reproduce the bug

I see that behavior both when using my everyday vimrc as well as when using the mini.vim below:

set nocompatible
set runtimepath^=/path/to/coc.nvim
filetype plugin indent on
syntax on
set hidden
  • I am running a fresh installation of Debian Bookworm.
  • Vim is the version shipped with Debian
  • CoC was installed from the release version using Plug.
  • I am using CoC on a TypeScript project (small to moderate size)
  • Tsserver was installed from Vim, as explained in the README
  • node is v6.15.1 (version shipped by Debian)

Screenshots

1

Open a TypeScript file using Vim, placing the cursor on a keyword with some code action available.
On the bottom half of the screen, you see the logs. Nothing noticeable for me.

Type :call CocAction('codeAction')

Image

2

Press enter.
The selection menu does appear, but Vim is no longer responsive.

Image

3

After 60 seconds, I see an error message. Vim is responsive again.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant