[PATCH] D139926: [clangd] Add semantic tokens for angle brackets

2023-01-16 Thread Nathan Ridge via Phabricator via cfe-commits
nridge added a comment. Sorry, that was a bad example as it's not actually valid. Here's a slightly modified one: template class a {}; constexpr int b = 2; constexpr int c = 3; constexpr int d = 4; a e; The parser knows the first `<` opens a template-param-list because the na

[PATCH] D139926: [clangd] Add semantic tokens for angle brackets

2023-01-16 Thread Nathan Ridge via Phabricator via cfe-commits
nridge added a comment. In D139926#4056478 , @kadircet wrote: > This will only make sure we have a distinction between `<<` and `>>` used as > operators vs `<`/`>` Note that `<<` and `>>` are not the only (or even the primary, in my mind) issue: there

[PATCH] D139926: [clangd] Add semantic tokens for angle brackets

2023-01-16 Thread Christian Kandeler via Phabricator via cfe-commits
ckandeler added a comment. In D139926#4056585 , @kadircet wrote: > Especially as this comes as two different `HighlightingKind`s and they're > likely to get colored differently, and having your matching brackets in > different colors is quite annoying.

[PATCH] D139926: [clangd] Add semantic tokens for angle brackets

2023-01-16 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added a comment. > Note that we use this information to *animate* the matching tokens, i.e. when > the cursor is on one of them, both it and its counterpart get a special > highlighting. That's why it's so important that the language server > guarantees they always come in pairs. Oh I

[PATCH] D139926: [clangd] Add semantic tokens for angle brackets

2023-01-16 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added a comment. Sorry for missing this one, apparently I've already started writing an answer but got context switching and forgot about it. > This is needed for clients that would like to visualize matching > opening and closing angle brackets, which can be valuable in non-trivial > t

[PATCH] D139926: [clangd] Add semantic tokens for angle brackets

2023-01-09 Thread Christian Kandeler via Phabricator via cfe-commits
ckandeler added a comment. In D139926#4033152 , @nridge wrote: > In D139926#4032473 , @ckandeler > wrote: > >> In D139926#4030782 , @nridge wrote: >> >>> It's true that t

[PATCH] D139926: [clangd] Add semantic tokens for angle brackets

2023-01-07 Thread Nathan Ridge via Phabricator via cfe-commits
nridge added a comment. In D139926#4032473 , @ckandeler wrote: > In D139926#4030782 , @nridge wrote: > >> It's true that there is an ambiguity between `<` and `>` as operators, vs. >> template arg/param list deli

[PATCH] D139926: [clangd] Add semantic tokens for angle brackets

2023-01-06 Thread Christian Kandeler via Phabricator via cfe-commits
ckandeler added a comment. In D139926#4030782 , @nridge wrote: > It's true that there is an ambiguity between `<` and `>` as operators, vs. > template arg/param list delimiters, but, at least in terms of user > understanding of code, my sense is that th

[PATCH] D139926: [clangd] Add semantic tokens for angle brackets

2023-01-06 Thread Nathan Ridge via Phabricator via cfe-commits
nridge added a comment. I'm happy to review the implementation, but I would first appreciate some guidance from @sammccall or @kadircet about whether we should add these semantic token kinds in the first place. They would be a non-standard extension to the LSP token kinds, so I think the use c

[PATCH] D139926: [clangd] Add semantic tokens for angle brackets

2022-12-13 Thread Christian Kandeler via Phabricator via cfe-commits
ckandeler updated this revision to Diff 482422. ckandeler added a comment. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139926/new/ https://reviews.llvm.org/D139926 Files: clang-tools-extra/clangd/SemanticHighlighting.cpp clang-tools

[PATCH] D139926: [clangd] Add semantic tokens for angle brackets

2022-12-13 Thread Christian Kandeler via Phabricator via cfe-commits
ckandeler created this revision. ckandeler added a reviewer: sammccall. Herald added subscribers: kadircet, arphaman. Herald added a project: All. ckandeler requested review of this revision. Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov. Herald added a project: clang-tools-extra.