TextEditor: add highlighter configure based on mimetype

The default implementation configures the generic highlighter based on
the documents file name and content. Add a way to force the highlighter
to use a highlight definition for a specific mime type.

Change-Id: I1c6fca1be9bcb5c4276b5aa2dbb724680fe98ddc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
David Schulz
2022-01-13 09:57:03 +01:00
parent 348652dc26
commit 08e375d6f7
2 changed files with 20 additions and 0 deletions

View File

@@ -457,7 +457,11 @@ public:
/// Abort code assistant if it is running.
void abortAssist();
/// Overwrite the current highlighter with a new generic highlighter based on the mimetype of
/// the current document
void configureGenericHighlighter();
/// Overwrite the current highlighter with a new generic highlighter based on the given mimetype
void configureGenericHighlighter(const Utils::MimeType &mimeType);
Q_INVOKABLE void inSnippetMode(bool *active); // Used by FakeVim.