Coc.nvim: option to show diagnostics virtual text only on current line

Created on 18 Mar 2020  路  10Comments  路  Source: neoclide/coc.nvim

currently when there are more than one diagnostic all of them are shown on virtual text (if enabled) which makes the whole file looks messy and confusing

2020-03-18_16-42

I suggest it could be done the way ALE does it, the symbol is shown in the sign column but the virtual text only appears when you are on that specific line

2020-02-17_07-16_1
2020-02-17_07-16

it could be an option, something like diagnostic.virtualTextcurrentLineOnly (could be shorter)

help wanted

All 10 comments

I would prefer floating window instead of virtual text.

I would prefer floating window instead of virtual.

Same here, but isn't that being provided already? In that case, then this feature-request is specific for virtualtext behavior.

then this feature-request is specific for virtualtext behavior.

yes that is what am going for, virtual text makes more sense to me than floating windows

Does this work for your expected?

"diagnostic.virtualText": false,
"diagnostic.checkCurrentLine": true,

Disable diagnostic on virtual text, and when your cursor line has diagnostic, will show in floating window.

@fannheyward This works fine
The whole point of this is having virtual text per line like ale

@chemzqm Shouldn't this be an option instead of hard-coded?

I prefer not

Please don't hard code this. I use virtual text diagnostics extensively.
This breaks my work flow. I floating window diagnostics cover code so I only trigger them when I need to see the whole diagnostic (rarely).

I'm sending PR

@Avi-D-coder Did you open a PR for this?

Yes: https://github.com/neoclide/coc.nvim/pull/1865

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lanox picture lanox  路  3Comments

rkulla picture rkulla  路  3Comments

zhou13 picture zhou13  路  3Comments

MacGuffinLife picture MacGuffinLife  路  4Comments

MaskRay picture MaskRay  路  3Comments