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

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 5 09:51:32 PDT 2023


Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>
Message-ID:
In-Reply-To: <llvm/llvm-project/pull/66514/clang at github.com>


tbaederr wrote:


> Also, redirecting output to a file doesn't always disable color output. From our precommit CI pipeline: https://buildkite.com/llvm-project/clang-ci/builds/4334#018af546-9a63-45f1-a8f9-6262f3d45b75 -- click on the raw log and you'll see it has contents like:
> 
> ```
> �_bk;t=1696332172990�~~~ Running global pre-checkout hook
> �_bk;t=1696332172991��[90m$�[0m /etc/buildkite-agent/hooks/pre-checkout
> �_bk;t=1696332173007�BUILDKITE_REPO: https://github.com/llvm-premerge-tests/llvm-project.git
> 
> �_bk;t=1696332173008�current remote URL: https://github.com/llvm-premerge-tests/llvm-project.git
> 
> �_bk;t=1696332173010�GC counter 16/20
> 
> �_bk;t=1696332173026��[90m$�[0m cd /var/lib/buildkite-agent/builds/linux-56-7f758798dd-v9p4k-1/llvm-project/clang-ci
> �_bk;t=1696332173026��[90m# OLDPWD added�[0m
> �_bk;t=1696332173026��[90m# PWD changed�[0m
> ```

Is that on purpose?

> Did you investigate what Richard was suggesting with caching "we should be back to normal lexing here" information and re-lexing from that point? That would make me feel a lot more comfortable than re-lexing the entire file.

I am looking at it, but I'm not certain where to get the information. I definitely want to avoid adding overhead to regular, diagnostic-less lexing.



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


More information about the cfe-commits mailing list