[clang] [clang][Diagnostics] Highlight code snippets (PR #66514)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 20 00:26:49 PDT 2023


tbaederr wrote:

> My biggest concerns is the handling of the keywords. It's very inaccurate and would hard to keep in sync.

Totally agree.



> I think we could get `TextDiagnostic` to be constructed with a `Preprocessor` object (by modifying the various `BeginSourceFile` implementations, I think)

Ah you meant the preprocessor object gets passed into the `TextDiagnostic`?


> This would let us call `getIdentifierInfo` on the preprocessor and from then we can determine if a particular identifier is a keyword. Is that something you considered?

That is essentially what I'd like to do but I was so far unable to do it :)

https://github.com/llvm/llvm-project/pull/66514


More information about the cfe-commits mailing list