https://bugs.kde.org/show_bug.cgi?id=446121

--- Comment #3 from Waqar Ahmed <waqar....@gmail.com> ---
> I am a little confused. On the one hand, you say that  "Kate has no idea 
> about the text its editing"
> but then you also say "We ignore a lot of
> information sent to us by the LSP" and "we do lack a couple of things" and 
> then even "For some themes I hardcoded the colors".

Let me try to clarify. In a more pedantic sense, kate has very little idea
about the text its editing. It does know about comments, strings, keywords.
This is basic stuff, so any decent syntax highlighter will be able to parse a
document and collect this information. But slightly more complex things such as
... a function, or scope, or what kind of a variable do we have are usually not
handled and even if they are, the results might not be very accurate.

The information we ignore is the things we know for sure we already have =>
language keywords, comments, strings. This is just for efficiency reasons.

The things we lack are
- modifier coloring support. LSP can send info about modifiers which you can
use to color things differently.
- some clangd specific things IIRC

> This makes it super-difficult for me to actually figure out if 
> 1) the LSP is sending the wrong information; or
> 2) Kate's handling of the LSP information is wrong; or
> 3) The actual *theme* is overwriting something.

What I mean is that the colors you will see depend on the theme you are using.
If a theme is bad, you will not see good semantic highlighting colors. And
*some* themes work better, because more effort was put into those themes to
make them look better.

> I am aware that Kate's syntax highlighting is a lot older than the LSP code, 
> and that it might be difficult to create 1-to-1 mappings for 
> everything, but with LSP being so common nowadays, wouldn't it make sense to 
> adopt the categories (type, variable...) that LSP uses?

It is not that different, and our themes already support the basic semantic
highlighting spec pretty well. Some things are missing (for e.g parameter
colors) that we can support.

So, if a theme doesn't look good, what you can do is modify the colors and see
the effect. But it will be a bit annoying to do this with LSP semantic
highlighting because you will need to restart Kate to see the newly applied
colors for semantic highlighting.

If you want to see which themes colors get mapped to what LSP information,
check the file semantic_tokens_legend.cpp in the Kate repo.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to