[PATCH] D50814: [clangd] transfer the fixits with the notes instead of adding them to the main diagnostic if request by the client

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 21 17:00:42 PDT 2018


arphaman added a comment.

In https://reviews.llvm.org/D50814#1207219, @ilya-biryukov wrote:

> Just to make sure I fully understand the use-case: could you elaborate a little more? Do you need to get exactly the same set of notes that clang provides?


Yep. We are replacing libclang in a client that currently consumes diagnostics as provided by clang. We'd like to avoid regressions in the client, so we are looking to match the diagnostics provided by clangd, at least for now.
It might be possible to recreate the original hierarchy using the diagnostics that are currently provided by clangd using some heroics on the client-side. However, we'd like to avoid them for now and get the data from Clangd directly :)

> Our current model seems to follow the clang's model, but it removes some notes and shows them as fix-its for the main diagnostic instead.
>  (We think it should provide a better user experience, because those notes do look like a way to present a fix-it to the user when you have only text-based output and they seem redundant when one has an editor-based UI with fix-its).

The current Clangd model certainly works well for newer clients who are built with LSP in mind from the get go. Sending diagnostics in a format similar to Clang's originals diagnostics would be helpful to clients that are transitioning though :)

> Not opposed to changing the model to meet other needs, but want to make sure what we're currently doing in clangd makes sense and understand your use-case better.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D50814





More information about the cfe-commits mailing list