forked from qt-creator/qt-creator
CmakeEditor: Use the generic SyntaxHighlighter.
Removed the cmakehighlighter class, and use the TextEditor::createGenericSyntaxHighlighter with the correct mime type instead, as it provides a more robust code highlighting. Task-number: QTCREATORBUG-3272 Change-Id: I96f6fa0912441500d7aa6ab3735bcfd49d9efa57 Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
committed by
Daniel Teske
parent
6af4b5a178
commit
76efc1ef56
@@ -30,7 +30,6 @@
|
||||
#include "cmakeeditor.h"
|
||||
|
||||
#include "cmakefilecompletionassist.h"
|
||||
#include "cmakehighlighter.h"
|
||||
#include "cmakeprojectconstants.h"
|
||||
#include "cmakeproject.h"
|
||||
|
||||
@@ -38,12 +37,14 @@
|
||||
#include <coreplugin/infobar.h>
|
||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/mimedatabase.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <texteditor/texteditoractionhandler.h>
|
||||
#include <texteditor/texteditorconstants.h>
|
||||
#include <texteditor/texteditorsettings.h>
|
||||
#include <texteditor/highlighterutils.h>
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QSharedPointer>
|
||||
@@ -247,13 +248,14 @@ CMakeEditorWidget::Link CMakeEditorWidget::findLinkAt(const QTextCursor &cursor,
|
||||
//
|
||||
// CMakeDocument
|
||||
//
|
||||
|
||||
CMakeDocument::CMakeDocument()
|
||||
: TextEditor::BaseTextDocument()
|
||||
{
|
||||
setId(CMakeProjectManager::Constants::CMAKE_EDITOR_ID);
|
||||
setMimeType(QLatin1String(CMakeProjectManager::Constants::CMAKEMIMETYPE));
|
||||
setSyntaxHighlighter(new CMakeHighlighter);
|
||||
|
||||
Core::MimeType mimeType = Core::MimeDatabase::findByType(QLatin1String(Constants::CMAKEMIMETYPE));
|
||||
setSyntaxHighlighter(TextEditor::createGenericSyntaxHighlighter(mimeType));
|
||||
}
|
||||
|
||||
QString CMakeDocument::defaultPath() const
|
||||
|
||||
Reference in New Issue
Block a user