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

Extremely slow execution and timeout errors #16

Closed
sangaline opened this issue May 31, 2019 · 12 comments
Closed

Extremely slow execution and timeout errors #16

sangaline opened this issue May 31, 2019 · 12 comments

Comments

@sangaline
Copy link

Every time that I save a file I get this message:

[coc.nvim] eslint will save operation timeout after 0.5s

If I save and quit, then I see this printed out in the terminal:

Error detected while processing function <lambda>27[1]..<SNR>187_onExit:
line    3:
E684: list index out of range: -1
E15: Invalid expression: a:out[len(a:out) - 1]

This is reproducible in even trivial files in empty projects, so I don't think the timeout is due to the complexity of the file being analyzed. Running :CocCommand eslint.executeAutofix manually works, but it can take 10-30 seconds on files with less than ten lines of code and no imports. Eslint works fine from the command-line without the same lag.

I'm using version 1.1.2 of the plugin and eslint v5.16.0 on Linux. My coc-eslint config is completely vanilla, I haven't done anything except install the plugin. Please let me know if there's additional information that I can provide which would be helpful.

@chemzqm
Copy link
Member

chemzqm commented May 31, 2019

Coc.nvim doesn't have code like a:out[len(a:out) - 1] .
I think it's issue with your other vim plugin.

@chemzqm chemzqm closed this as completed May 31, 2019
@chemzqm
Copy link
Member

chemzqm commented May 31, 2019

Use output channel to see what happened https://github.com/neoclide/coc.nvim/wiki/Debug-language-server#using-output-channel

@sangaline
Copy link
Author

Thanks for the quick reply. It seems like the second error was actually from a prettier plugin, but I still have the coc-eslint timeouts even when I disable that plugin. The output channel shows this after saving:

  1 [Info  - 17:21:14] ESLint server running in node v8.11.2
  2 [Info  - 17:21:14] ESLint library loaded from: /tmp/simple-project/node_modules/eslint/lib/api.js
  3 [Error  - 17:21:38] Failed to apply command: eslint.applyAutoFix

When I save and quit, I see this now:

[coc.nvim] eslint will save operation timeout after 0.5s

@chemzqm
Copy link
Member

chemzqm commented May 31, 2019

You can try eslint --fix in your terminal, if it takes more than 0.5s, then it's expected, you have to disable autoFixOnSave in your configuration file.
Maybe caused by some wired configuration.

@sangaline
Copy link
Author

Eslint takes longer than 0.5s when I run it from the command-line, but the autoformatting takes significantly less time than it does with the plugin. Isn't the default value of autoFixOnSave false? Even when I explicitly set it to false, I still get the timeout error when I save and quit. Is this option possibly not being respected?

@chemzqm
Copy link
Member

chemzqm commented Jun 3, 2019

Could be your other plugin fornating your code.

@sangaline
Copy link
Author

Are you saying that another plugin might be calling eslint.executeAutofix? I get the error with

{
  "eslint.autoFix": false,
  "eslint.autoFixOnSave": false,
  "eslint.enable": true,
}

but it goes away when I disable the plugin entirely:

{
  "eslint.autoFix": false,
  "eslint.autoFixOnSave": false,
  "eslint.enable": false,
}

@chemzqm
Copy link
Member

chemzqm commented Jun 4, 2019

It's possible get called in your vim code, or it's overwritten in your vim configuration.
"eslint.autoFixOnSave": false works as expected for me.

@alextrastero
Copy link

alextrastero commented Jul 17, 2019

@sangaline did you manage to solve this? Attached screenshot of my case
foo

Happens when I save the file

@wddwycc
Copy link

wddwycc commented Apr 13, 2020

I have this issue when used together with coc-prettier

tony added a commit to tony/vim-config-framework that referenced this issue Jun 20, 2020
@tony
Copy link

tony commented Jun 20, 2020

Removing coc-prettier fixed the lag to me.

@nomasprime
Copy link

Does anyone know how to change the timeout? Seems to be general issue that 0.5s is too short.

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

6 participants