ladybird/Userland/Libraries/LibCpp
Itamar 4646bf4b92 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.
2022-02-09 00:51:31 +01:00
..
Tests LibCpp: Update regressions tests results 2022-02-09 00:51:31 +01:00
AST.cpp LibCpp: Add support for parsing function types 2021-08-02 01:03:59 +02:00
AST.h LibCpp: Fix Declaration::is_member() 2022-02-09 00:51:31 +01:00
CMakeLists.txt LibCpp: Add SemanticSyntaxHighlighter 2022-02-09 00:51:31 +01:00
Lexer.cpp LibCpp: Update list of well-known C++ types to match current AK 2021-11-30 23:34:40 +01:00
Lexer.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
Parser.cpp LibCpp: Fix end position calculation for various AST node types 2022-02-09 00:51:31 +01:00
Parser.h LibCpp: Add public Parser::tokens() method 2022-02-09 00:51:31 +01:00
Preprocessor.cpp LibCpp: Fix lexing of IncludePath token 2022-02-09 00:51:31 +01:00
Preprocessor.h LibCpp: Add Preprocessor:unprocessed_token() 2022-02-09 00:51:31 +01:00
SemanticSyntaxHighlighter.cpp LibCpp: Add SemanticSyntaxHighlighter 2022-02-09 00:51:31 +01:00
SemanticSyntaxHighlighter.h LibCpp: Add SemanticSyntaxHighlighter 2022-02-09 00:51:31 +01:00
SyntaxHighlighter.cpp LibCpp: Use lex_iterable() where applicable 2021-08-21 22:09:56 +02:00
SyntaxHighlighter.h LibCpp: Add SemanticSyntaxHighlighter 2022-02-09 00:51:31 +01:00
Token.cpp LibCpp: Modify Token::to_string() to include more information 2021-05-22 15:52:11 +02:00
Token.h Userland: Undefine FOR_EACH_TOKEN_TYPE everywhere 2022-02-07 18:39:50 +01:00