diff options
author | Itamar <itamar8910@gmail.com> | 2022-02-06 23:02:34 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-02-09 00:51:31 +0100 |
commit | 4646bf4b9221490f1eca39f894d84a34646f5421 (patch) | |
tree | a76200f8f105fb32978885759c45e37e525b05df /Tests/UserspaceEmulator | |
parent | 4737fc2485d6d5b311e5b3c6f7bac096fc30412b (diff) | |
download | serenity-4646bf4b9221490f1eca39f894d84a34646f5421.zip |
LibCpp: Add SemanticSyntaxHighlighter
The SemanticSyntaxHighlighter uses TokenInfo results from the
language server to provide 'semantic' syntax highlighting, which
provides more fin-grained text spans results.
For example, the SemanticSyntaxHighlighter can color function calls,
member fields references and user-defined types in different colors.
With the simple lexer-only syntax highlighter, all of these tokens were
given the same text highlighting span type.
Since we have to provide immediate highlighting feedback to the user
after each edit and before we get the result for the language server,
we use a heuristic which computes the diff between the current tokens
and the last known tokens with compete semantic information
(We use LibDiff for this).
This heuristic is not very performant, and starts feeling sluggish with
bigger (~200 LOC) files.
A possible future improvement would be only computing the diff for
tokens in text ranges that have changes since the last commit.
Diffstat (limited to 'Tests/UserspaceEmulator')
0 files changed, 0 insertions, 0 deletions