1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 22:25:08 +00:00

LibSyntax+Userland: Make LibSyntax not depend on LibGUI

This moves some stuff around to make LibGUI depend on LibSyntax instead
of the other way around, as not every application that wishes to do
syntax highlighting is necessarily a LibGUI (or even a GUI) application.
This commit is contained in:
Ali Mohammad Pur 2023-08-29 12:43:41 +03:30 committed by Tim Flynn
parent 2495302991
commit ba4db899d4
26 changed files with 773 additions and 683 deletions

View file

@ -26,9 +26,9 @@ void GitCommitSyntaxHighlighter::rehighlight(Palette const& palette)
GitCommitLexer lexer(text);
auto tokens = lexer.lex();
Vector<GUI::TextDocumentSpan> spans;
Vector<Syntax::TextDocumentSpan> spans;
for (auto& token : tokens) {
GUI::TextDocumentSpan span;
Syntax::TextDocumentSpan span;
span.range.set_start({ token.m_start.line, token.m_start.column });
span.range.set_end({ token.m_end.line, token.m_end.column });
span.attributes = style_for_token_type(palette, token.m_type);