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

autoFix不管用 #82

Closed
rmGFW opened this issue Nov 6, 2020 · 9 comments
Closed

autoFix不管用 #82

rmGFW opened this issue Nov 6, 2020 · 9 comments

Comments

@rmGFW
Copy link

rmGFW commented Nov 6, 2020

image

我已经在coc-settings.json 添加了这个配置
可是我保存js 文件并不会自动格式化

@Dema
Copy link

Dema commented Dec 22, 2020

Yeah, something got broken since like a week or so. :CocCommand eslint.executeAutofix works but fix on save is broken

@chemzqm
Copy link
Member

chemzqm commented Jan 4, 2021

Eslint doesn't do format.

@chemzqm chemzqm closed this as completed Jan 4, 2021
@ghost
Copy link

ghost commented Jan 4, 2021

@chemzqm could you explain what you mean please?

@chemzqm
Copy link
Member

chemzqm commented Jan 4, 2021

It only works with saved files, could be the problem you got.

@ghost
Copy link

ghost commented Jan 4, 2021

No, the files I'm working on are saved and it used to work until recently. I've had to add this to my vimrc to temporarily fix the behaviour:

autocmd BufWritePre *.{js,jsx,ts,tsx} if exists(":CocAction") | :call CocAction('runCommand', 'eslint.executeAutofix') | sleep 100m | endif

@Dema
Copy link

Dema commented Jan 4, 2021

@chemzqm Could you, please, reopen the ticket. It is not about "formatting", it's about autoFixOnSave being broken. I've tried to bisect the issue but kind of failed. I tried downgrading eslint-coc while having latest coc and it doesn't work. I failed to downgrade coc deep enough to find a working combo. 😢 I've had typescript errors with Promise.resolve() demanding non-empty first argument.

@chemzqm
Copy link
Member

chemzqm commented Jan 4, 2021

You have to create autocmd yourself if you want it always works neoclide/coc.nvim#2704.

VSCode changed to use source code actions, but we don't have yet.

If you have bug with it, you should provide output from eslint and the reproduce way.

@ghost
Copy link

ghost commented Jan 4, 2021

Do you plan on implementing source code actions?

@Dema
Copy link

Dema commented Jan 4, 2021

Aah, I see, you've already removed the CocConfig option "eslint.autoFix": true, Thanks! I'll add the autocmd!

As for source code actions, I actually switched to neovim+CoC because of them 😄. My VSCode freezes for about 10-20 seconds on "Getting source actions from eslint" when I save a typescript file

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

3 participants