nvim-neotest / neotest-go

MIT License
125 stars 43 forks source link

docs(README): add virtual text format tip #15

Closed jens1205 closed 1 year ago

jens1205 commented 1 year ago

Add recommendation about diagnostic config, if diagnostic in neotest is enabled.

akinsho commented 1 year ago

@jens1205 I noticed you removed this from the original PR I don't use the diagnostics feature personally, but I think it's fine to do this formatting automatically inside this plugin. It doesn't seem useful for anyone to have the original with all the bloated stuff you mention. What do you think about just doing it inside the plugin, so people don't have to set up all this stuff themselves? You could make it optional using a config in case for some reason someone complained.

jens1205 commented 1 year ago

The thing is that if you already remove all tabs, newlines and spaces inside the plugin, the information is lost to early.

I like to have all these formating retained, so I can see it in the diagnostic floating window which pops up when using vim.diagnostic.goto_next(). But I don't want to see it in the diagnostic virtual text.

Example how it is working with my suggested setup: Bildschirmfoto 2022-08-30 um 07 11 42

And here a screenshot how it would look like if the tabs / newlines are already stripped in neotest-go:

Bildschirmfoto 2022-08-30 um 07 13 39

I prefer the first version.

And also from a "seperation of concerns" view I think it is cleaner this way. There is a reason this virtual_text.format configuration exists - thats the place to format if there are specific requirements for the format of the single virtual text line, nowhere else.

akinsho commented 1 year ago

@jens1205 that's fair enough, the main reason I mentioned was just in case it was possible to make things easier for other people, but as you've explained it's an undesirable trade-off