Skip to content
Commit b54e1356 authored by Milian Wolff's avatar Milian Wolff Committed by Christoph Cullmann
Browse files

WIP: Add support for semantic highlighting in the language server

See https://github.com/microsoft/vscode-languageserver-node/pull/367

This is mostly a POC at this point. It works for the clangd highlight
support found in clang 9.0+ - I haven't tested any other
implementations.

Most notably, this patch will need more work in making the highlight
attributes configurable. Currently I'm just using random colors
that show what's possible, but they result in some serious eye cancer.
To fix this, I believe we finally have to open up more of the
available schema highlighting information and make it accessible
through a new interface or similar in KTextEditor. Then we can either
try to match scope names to KTextEditor attribute names, or better
yet we expand our highlighting files with something like TextMate
scopes to allow direct matching.

Furthermore, this patch also needs more work in its handling of
moving ranges. Currently, it just discards everything and starts
over whenever we get a new notification but that's not really ideal.
Most of the time nothing big will have changed, so we should try
to recycle the previously available ranges instead. Additionally,
we should consider leveraging the ability to map between versions
to translate ranges if the document got updated in-between. At the
minimum, we should discard highlighting requests that don't match
the current version.
parent 06f567fa
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment