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

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 18 01:15:05 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>,
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>,
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:

> > > I really like this direction, thanks!
> > > I left a few comments, i will do another pass later
> > 
> > 
> > So you'd accept the lexing slowdown instead of using a maximum file size for highlighting?
> 
> Do I understand correctly that with the latest change there is no noticeable perf impact? Otherwise, yes I'm happy limiting to 2MB - it seems the biggest files in clang are about 500K. So it should only disable highlighting on generated files, which seems reasonable

Kind of  - [this run](http://llvm-compile-time-tracker.com/compare.php?from=6ade5183232dc1398205d7c9dbe21243b2560837&to=5ad516d39b6706af6fd55eded264aba4ba432ad2&stat=instructions:u) only shows noticeable slowdown in one test. But we also only highlight the main file right now - that means we don't get syntax highlighting in included files and implementing that would probably make it a bit slower as well since we'd have to map the save points to their FileID.

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


More information about the cfe-commits mailing list