Giter Site home page Giter Site logo

Comments (13)

fannheyward avatar fannheyward commented on June 12, 2024

The diagnostic format is defined [source code] [severity] message in https://github.com/neoclide/coc.nvim/blob/3c462c6486725f7e3a82900e75c671d5d31bf093/src/diagnostic/manager.ts#L306. coc needs to add diagnostic format support.

from coc-clangd.

kadircet avatar kadircet commented on June 12, 2024

btw, we might also consider moving the full diagnostic info to the command line and only show diagnostic message in the floating window.

I also think it would be better if diag(floating window) hasn't moved with the cursor, it could pop-up once the user enters diag range and stay there until user exits it.

from coc-clangd.

sam-mccall avatar sam-mccall commented on June 12, 2024

I also think it would be better if diag(floating window) hasn't moved with the cursor, it could pop-up once the user enters diag range and stay there until user exits it.

Yeah, I don't know if this is easy/hard to do.
I do find myself wishing it was pinned to column zero instead of anchored at the cursor, because it tends to truncate or wrap.

from coc-clangd.

fannheyward avatar fannheyward commented on June 12, 2024

I also think it would be better if diag(floating window) hasn't moved with the cursor

If you are using Neovim, add "diagnostic.virtualText": true to coc-settings.json, the diagnostic message will pinned with virtual text at the end of line.

from coc-clangd.

sam-mccall avatar sam-mccall commented on June 12, 2024

Thanks for the pointer. I think that's the one for preview window, and this one is for floating windows:
https://github.com/neoclide/coc.nvim/blob/3c462c6486725f7e3a82900e75c671d5d31bf093/src/diagnostic/manager.ts#L458

(Some of the concerns apply to both, but space is much less of a concern in the preview window for instance)

If you are using Neovim, add "diagnostic.virtualText": true to coc-settings.json, the diagnostic message will pinned with virtual text at the end of line.

This is nice - I tried it out, but one of our goals is to support a bunch of internal users who are using a particular version of vim (fairly recent: 8.1.2269).

from coc-clangd.

sam-mccall avatar sam-mccall commented on June 12, 2024

So while customizability (and highlighting) is nice, playing with this makes me more convinced that the defaults can be improved first. Does this seem more readable

Before:
image
image

After:
image
image

from coc-clangd.

sam-mccall avatar sam-mccall commented on June 12, 2024

@kadircet points out that floating windows use a different color per severity, as well as the gutter marker, and the Error: is mostly noise:

image
image

from coc-clangd.

sam-mccall avatar sam-mccall commented on June 12, 2024

neoclide/coc.nvim#1564

from coc-clangd.

fannheyward avatar fannheyward commented on June 12, 2024

Changed on coc by adding diagnostic.format, without change the default style. User can define format they want, eg drop the source part.

from coc-clangd.

sam-mccall avatar sam-mccall commented on June 12, 2024

Thanks for doing that!
Having it customizable means ~all power-users will be happy, but IME most non-power-users won't work out how to change it even if it bothers them.

How do you feel about changing the default style? I think either "%message\n[%source%code]" or "%message" would be a clearer default, with more info available to those who want it.

from coc-clangd.

fannheyward avatar fannheyward commented on June 12, 2024

I don't like to change default style. Current style [source code] [E] message in most case is ok, for example:

  1. [pylint E0104] [E] Return outside function
  2. [json 515] [E] Colon expected
  3. [tsserver 6133] [I] 'a' is declared but its value is never read.

The code part is needed and useful for users. On clangd side, the noisy is because too-long-error-code. We can overwrite the default diagnostic.format in coc-clangd, I make it default %message [%source].

from coc-clangd.

chemzqm avatar chemzqm commented on June 12, 2024

@fannheyward overwrite default configuration by extension doesn't seem to be a good idea, the user install an extension and the behavior unexpected changed.

from coc-clangd.

fannheyward avatar fannheyward commented on June 12, 2024

@chemzqm the overwrite configurations has been removed.

from coc-clangd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.