Coc.nvim: Add `:cdo` equivalent for coc list

Created on 3 Apr 2019  路  5Comments  路  Source: neoclide/coc.nvim


name: Add :cdo equivalent for coc list

_Note:_ similar to https://github.com/neoclide/coc.nvim/issues/480, but my request is more general.

Is your feature request related to a problem? Please describe.
When I work on a JavaScript project, I use eslint to lint my code. Sometimes, I add a new rule to have stronger checks. In this case, I might get 150 new errors.
I don't want to fix all these new errors at once: I ignore them at first and solve them progressively with time.

To ignore these errors, it's super convenient to run the following command when eslint populates the quickfix list:

:cdo norm O// eslint-disable-next-line

It adds the // eslint-disable-next-line before each error and thus leaves me at peace.

It used to work with Neomake because it was populating the quickfix list.
Coc has its own list system (used by coc diagnostics, which is what provides me the eslint errors now), and I haven't found a way to do the same thing.

Describe the solution you'd like

A :CocListDo would suit this case 馃槈

Describe alternatives you've considered
Another very good option would be to be able to populate the quickfix/location list instead of Coc List when running diagnostics.

It would allow to use :cdo and would have the huge benefit of keeping all the other existing quickfix shortcuts/commands one may have 馃槉

What do you think?

(Also: thanks for the _absolutely amazing_ plugin 馃拵. I am really amazed by the quality of this, thank you!)

enhancement

All 5 comments

You can visual select lines on normal mode and then press <space> mark them as selected, press <tab> and select quickfix action to convert selected lines to quicklist.

Glad to hear that it's possible 馃槉

I didn't manage to find the quickfix action though. Am I missing something?
This is the flow language server on this GIF but I tried with eslint as well.

I opened the diagnostics list, went to normal mode <C-o>, selected the lines Vjjjj, pressed <tab>.

coc-list

Should be old version of coc.nvim, use

  Plug 'neoclide/coc.nvim', {'do': { -> coc#util#install()}}

to installed lastest bundle.

Oh, it's a brand new feature! That's fantastic, thanks 馃槉
My Plug was set to fetch only new releases, not nightly.

But.. I can't try it out because :CocList freezes since the commit cfd60c768397d1b049863c8df0bdf5833a953ba9 (so do commands like :CocInfo).
I'll try to add more details to reproduce and file an issue.

Thank you for being so fast!

Finally managed to have it working, it's fantastic! Thanks :blush:

Was this page helpful?
0 / 5 - 0 ratings