KsyntaxHighlighting::Definition and rules for tokens
-
I am writing component for viewing huge files > 4 GiB, which are not loaded to memory.
(https://github.com/siplasplas/qt-textviewer)I want add syntax highlighting but can’t use QTextDocument and KsyntaxHighlighting::SyntaxHighlighter due to my component from ground.
I wanna use KsyntaxHighlighting::Repository, KsyntaxHighlighting::Definition and KSyntaxHighlighting::Format.
Definition has methods/fields such as foldingEnabled or multiLineCommentMarker. Format has method returning at oncve text styles for thema, and I can’t find methods for rules, for example rule to detect int decimal or octal or string.
This is question about KDE, where can I ask if not here ?================
I have cloned https://invent.kde.org/frameworks/syntax-highlighting,
and in SyntaxHighlighter::highlightBlock isconst auto nextBlock = currentBlock().next(); if (nextBlock.isValid()) { QMetaObject::invokeMethod(this, "rehighlightBlock", Qt::QueuedConnection, Q_ARG(QTextBlock, nextBlock)); }
but I don't find "rehighlightBlock" in any other place in whole repository.
I found many other repositories :
https://invent.kde.org/akselmo/syntax-highlighting
https://invent.kde.org/ribhavkaul/syntax-highlighting
........
and many, many other.
I don't know which is used in KF5/KF6. Is possible choose code between akselmo,ribhavkaul and others?
I see, 80 repositories are cloned from frameworks/syntax-highlighting,
-
Hi,
rehighlightBlock belongs to QSyntaxHighlighter.
Use the original repos, the clones are usually for people to do development before creating a merge request.