2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-11-10 14:01:09 +01:00
|
|
|
**
|
2014-01-07 13:27:11 +01:00
|
|
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
2012-10-02 09:12:39 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
2010-11-10 14:01:09 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2010-11-10 14:01:09 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and Digia. For licensing terms and
|
|
|
|
|
** conditions see http://qt.digia.com/licensing. For further information
|
|
|
|
|
** use the contact form at http://qt.digia.com/contact-us.
|
2010-11-10 14:01:09 +01:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
|
** General Public License version 2.1 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
|
|
|
**
|
|
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
2010-12-17 17:14:20 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2010-11-10 14:01:09 +01:00
|
|
|
|
|
|
|
|
#include "glsleditor.h"
|
|
|
|
|
#include "glsleditorconstants.h"
|
|
|
|
|
#include "glsleditorplugin.h"
|
2010-11-10 15:44:59 +01:00
|
|
|
#include "glslhighlighter.h"
|
2010-11-26 10:59:33 +01:00
|
|
|
#include "glslautocompleter.h"
|
2011-04-15 16:19:23 +02:00
|
|
|
#include "glslcompletionassist.h"
|
2014-07-31 18:48:22 +02:00
|
|
|
#include "glslindenter.h"
|
2010-11-10 14:01:09 +01:00
|
|
|
|
2010-11-12 12:44:55 +01:00
|
|
|
#include <glsl/glsllexer.h>
|
|
|
|
|
#include <glsl/glslparser.h>
|
|
|
|
|
#include <glsl/glslengine.h>
|
2010-11-26 12:55:24 +01:00
|
|
|
#include <glsl/glslsemantic.h>
|
2010-11-26 15:00:46 +01:00
|
|
|
#include <glsl/glslsymbols.h>
|
2010-11-12 12:44:55 +01:00
|
|
|
|
2010-11-10 14:01:09 +01:00
|
|
|
#include <coreplugin/actionmanager/actionmanager.h>
|
|
|
|
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
|
|
|
|
#include <coreplugin/actionmanager/command.h>
|
|
|
|
|
#include <coreplugin/editormanager/editormanager.h>
|
|
|
|
|
#include <coreplugin/icore.h>
|
2014-08-19 22:20:55 +02:00
|
|
|
#include <coreplugin/id.h>
|
|
|
|
|
|
2010-11-10 14:01:09 +01:00
|
|
|
#include <extensionsystem/pluginmanager.h>
|
2014-08-19 22:20:55 +02:00
|
|
|
#include <extensionsystem/pluginspec.h>
|
|
|
|
|
|
2010-11-10 14:01:09 +01:00
|
|
|
#include <texteditor/refactoroverlay.h>
|
2014-08-19 22:20:55 +02:00
|
|
|
#include <texteditor/syntaxhighlighter.h>
|
|
|
|
|
#include <texteditor/texteditoractionhandler.h>
|
|
|
|
|
#include <texteditor/texteditorconstants.h>
|
|
|
|
|
#include <texteditor/texteditorsettings.h>
|
|
|
|
|
|
2010-11-10 14:01:09 +01:00
|
|
|
#include <utils/changeset.h>
|
2014-08-19 22:20:55 +02:00
|
|
|
#include <utils/qtcassert.h>
|
2010-11-10 14:01:09 +01:00
|
|
|
#include <utils/uncommentselection.h>
|
|
|
|
|
|
2014-08-19 22:20:55 +02:00
|
|
|
#include <QCoreApplication>
|
|
|
|
|
#include <QSettings>
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QComboBox>
|
2014-08-19 12:12:45 +02:00
|
|
|
#include <QFileInfo>
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QHeaderView>
|
2014-08-19 12:12:45 +02:00
|
|
|
#include <QTextBlock>
|
|
|
|
|
#include <QTimer>
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QTreeView>
|
2010-11-10 14:01:09 +01:00
|
|
|
|
2014-08-19 22:20:55 +02:00
|
|
|
using namespace TextEditor;
|
2010-11-10 14:01:09 +01:00
|
|
|
using namespace GLSL;
|
2014-08-19 22:20:55 +02:00
|
|
|
|
2014-08-21 20:11:15 +02:00
|
|
|
namespace GlslEditor {
|
2014-08-19 22:20:55 +02:00
|
|
|
namespace Internal {
|
2010-11-10 14:01:09 +01:00
|
|
|
|
|
|
|
|
enum {
|
|
|
|
|
UPDATE_DOCUMENT_DEFAULT_INTERVAL = 150
|
|
|
|
|
};
|
|
|
|
|
|
2010-11-29 17:21:47 +01:00
|
|
|
class CreateRanges: protected GLSL::Visitor
|
|
|
|
|
{
|
|
|
|
|
QTextDocument *textDocument;
|
|
|
|
|
Document::Ptr glslDocument;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
CreateRanges(QTextDocument *textDocument, Document::Ptr glslDocument)
|
|
|
|
|
: textDocument(textDocument), glslDocument(glslDocument) {}
|
|
|
|
|
|
|
|
|
|
void operator()(GLSL::AST *ast) { accept(ast); }
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
using GLSL::Visitor::visit;
|
|
|
|
|
|
|
|
|
|
virtual void endVisit(GLSL::CompoundStatementAST *ast)
|
|
|
|
|
{
|
|
|
|
|
if (ast->symbol) {
|
|
|
|
|
QTextCursor tc(textDocument);
|
|
|
|
|
tc.setPosition(ast->start);
|
|
|
|
|
tc.setPosition(ast->end, QTextCursor::KeepAnchor);
|
|
|
|
|
glslDocument->addRange(tc, ast->symbol);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-08-22 17:16:02 +02:00
|
|
|
//
|
|
|
|
|
// GlslEditorWidget
|
|
|
|
|
//
|
2010-11-29 17:21:47 +01:00
|
|
|
|
2014-08-22 17:16:02 +02:00
|
|
|
class GlslEditorWidget : public BaseTextEditorWidget
|
2010-11-29 17:21:47 +01:00
|
|
|
{
|
2014-08-22 17:16:02 +02:00
|
|
|
public:
|
|
|
|
|
GlslEditorWidget();
|
2010-11-29 17:21:47 +01:00
|
|
|
|
2014-08-22 17:16:02 +02:00
|
|
|
int editorRevision() const;
|
|
|
|
|
bool isOutdated() const;
|
2010-11-29 17:21:47 +01:00
|
|
|
|
2014-08-22 17:16:02 +02:00
|
|
|
QSet<QString> identifiers() const;
|
|
|
|
|
|
2014-09-04 00:04:18 +02:00
|
|
|
AssistInterface *createAssistInterface(AssistKind assistKind, AssistReason reason) const;
|
2014-08-22 17:16:02 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void updateDocumentNow();
|
|
|
|
|
void setSelectedElements();
|
|
|
|
|
QString wordUnderCursor() const;
|
|
|
|
|
|
|
|
|
|
QTimer m_updateDocumentTimer;
|
|
|
|
|
QComboBox *m_outlineCombo;
|
|
|
|
|
Document::Ptr m_glslDocument;
|
|
|
|
|
};
|
2010-11-29 17:21:47 +01:00
|
|
|
|
2014-08-19 22:20:55 +02:00
|
|
|
GlslEditorWidget::GlslEditorWidget()
|
2010-11-10 14:01:09 +01:00
|
|
|
{
|
2014-09-03 10:57:51 +02:00
|
|
|
setCompletionAssistProvider(ExtensionSystem::PluginManager::getObject<GlslCompletionAssistProvider>());
|
2014-08-21 08:29:55 +02:00
|
|
|
setAutoCompleter(new GlslCompleter);
|
2014-01-09 18:04:45 +01:00
|
|
|
m_outlineCombo = 0;
|
2010-11-10 14:01:09 +01:00
|
|
|
setParenthesesMatchingEnabled(true);
|
|
|
|
|
setMarksVisible(true);
|
|
|
|
|
setCodeFoldingSupported(true);
|
|
|
|
|
|
2014-08-19 22:20:55 +02:00
|
|
|
m_updateDocumentTimer.setInterval(UPDATE_DOCUMENT_DEFAULT_INTERVAL);
|
|
|
|
|
m_updateDocumentTimer.setSingleShot(true);
|
|
|
|
|
connect(&m_updateDocumentTimer, &QTimer::timeout,
|
|
|
|
|
this, &GlslEditorWidget::updateDocumentNow);
|
2010-11-10 14:01:09 +01:00
|
|
|
|
2014-08-19 22:20:55 +02:00
|
|
|
connect(this, &QPlainTextEdit::textChanged,
|
|
|
|
|
[this]() { m_updateDocumentTimer.start(); });
|
2010-11-10 14:01:09 +01:00
|
|
|
|
2014-08-01 17:54:26 +02:00
|
|
|
m_outlineCombo = new QComboBox;
|
|
|
|
|
m_outlineCombo->setMinimumContentsLength(22);
|
|
|
|
|
|
|
|
|
|
// ### m_outlineCombo->setModel(m_outlineModel);
|
|
|
|
|
|
|
|
|
|
QTreeView *treeView = new QTreeView;
|
|
|
|
|
treeView->header()->hide();
|
|
|
|
|
treeView->setItemsExpandable(false);
|
|
|
|
|
treeView->setRootIsDecorated(false);
|
|
|
|
|
m_outlineCombo->setView(treeView);
|
|
|
|
|
treeView->expandAll();
|
|
|
|
|
|
|
|
|
|
//m_outlineCombo->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
|
|
|
|
|
|
|
|
|
// Make the combo box prefer to expand
|
|
|
|
|
QSizePolicy policy = m_outlineCombo->sizePolicy();
|
|
|
|
|
policy.setHorizontalPolicy(QSizePolicy::Expanding);
|
|
|
|
|
m_outlineCombo->setSizePolicy(policy);
|
|
|
|
|
|
2014-08-19 22:20:55 +02:00
|
|
|
insertExtraToolBarWidget(BaseTextEditorWidget::Left, m_outlineCombo);
|
2014-08-01 17:54:26 +02:00
|
|
|
|
2010-11-10 14:01:09 +01:00
|
|
|
// if (m_modelManager) {
|
|
|
|
|
// m_semanticHighlighter->setModelManager(m_modelManager);
|
|
|
|
|
// connect(m_modelManager, SIGNAL(documentUpdated(GLSL::Document::Ptr)),
|
|
|
|
|
// this, SLOT(onDocumentUpdated(GLSL::Document::Ptr)));
|
|
|
|
|
// connect(m_modelManager, SIGNAL(libraryInfoUpdated(QString,GLSL::LibraryInfo)),
|
|
|
|
|
// this, SLOT(forceSemanticRehighlight()));
|
|
|
|
|
// connect(this->document(), SIGNAL(modificationChanged(bool)), this, SLOT(modificationChanged(bool)));
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-30 16:30:31 +02:00
|
|
|
int GlslEditorWidget::editorRevision() const
|
2010-11-10 14:01:09 +01:00
|
|
|
{
|
|
|
|
|
//return document()->revision();
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-30 16:30:31 +02:00
|
|
|
bool GlslEditorWidget::isOutdated() const
|
2010-11-10 14:01:09 +01:00
|
|
|
{
|
|
|
|
|
// if (m_semanticInfo.revision() != editorRevision())
|
|
|
|
|
// return true;
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-30 16:30:31 +02:00
|
|
|
QString GlslEditorWidget::wordUnderCursor() const
|
2010-11-10 14:01:09 +01:00
|
|
|
{
|
|
|
|
|
QTextCursor tc = textCursor();
|
2013-04-18 18:21:17 +02:00
|
|
|
const QChar ch = document()->characterAt(tc.position() - 1);
|
2010-11-10 14:01:09 +01:00
|
|
|
// make sure that we're not at the start of the next word.
|
|
|
|
|
if (ch.isLetterOrNumber() || ch == QLatin1Char('_'))
|
|
|
|
|
tc.movePosition(QTextCursor::Left);
|
|
|
|
|
tc.movePosition(QTextCursor::StartOfWord);
|
|
|
|
|
tc.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor);
|
|
|
|
|
const QString word = tc.selectedText();
|
|
|
|
|
return word;
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-30 16:30:31 +02:00
|
|
|
void GlslEditorWidget::updateDocumentNow()
|
2010-11-10 14:01:09 +01:00
|
|
|
{
|
2014-08-19 22:20:55 +02:00
|
|
|
m_updateDocumentTimer.stop();
|
2010-11-12 12:44:55 +01:00
|
|
|
|
2014-08-01 23:31:56 +02:00
|
|
|
int variant = languageVariant(textDocument()->mimeType());
|
2010-11-12 12:44:55 +01:00
|
|
|
const QString contents = toPlainText(); // get the code from the editor
|
|
|
|
|
const QByteArray preprocessedCode = contents.toLatin1(); // ### use the QtCreator C++ preprocessor.
|
|
|
|
|
|
2010-11-29 17:21:47 +01:00
|
|
|
Document::Ptr doc(new Document());
|
2014-08-19 22:20:55 +02:00
|
|
|
Engine *engine = new GLSL::Engine();
|
2010-11-29 17:21:47 +01:00
|
|
|
doc->_engine = new GLSL::Engine();
|
|
|
|
|
Parser parser(doc->_engine, preprocessedCode.constData(), preprocessedCode.size(), variant);
|
2010-11-25 12:19:57 +01:00
|
|
|
TranslationUnitAST *ast = parser.parse();
|
2010-11-29 09:54:27 +01:00
|
|
|
if (ast != 0 || extraSelections(CodeWarningsSelection).isEmpty()) {
|
|
|
|
|
Semantic sem;
|
2010-11-29 17:21:47 +01:00
|
|
|
Scope *globalScope = engine->newNamespace();
|
|
|
|
|
doc->_globalScope = globalScope;
|
2014-08-21 08:29:55 +02:00
|
|
|
const GlslEditorPlugin::InitFile *file = GlslEditorPlugin::shaderInit(variant);
|
2013-09-10 18:27:42 +02:00
|
|
|
sem.translationUnit(file->ast, globalScope, file->engine);
|
|
|
|
|
if (variant & Lexer::Variant_VertexShader) {
|
2014-08-21 08:29:55 +02:00
|
|
|
file = GlslEditorPlugin::vertexShaderInit(variant);
|
2013-09-10 18:27:42 +02:00
|
|
|
sem.translationUnit(file->ast, globalScope, file->engine);
|
|
|
|
|
}
|
|
|
|
|
if (variant & Lexer::Variant_FragmentShader) {
|
2014-08-21 08:29:55 +02:00
|
|
|
file = GlslEditorPlugin::fragmentShaderInit(variant);
|
2013-09-10 18:27:42 +02:00
|
|
|
sem.translationUnit(file->ast, globalScope, file->engine);
|
|
|
|
|
}
|
2010-11-29 17:21:47 +01:00
|
|
|
sem.translationUnit(ast, globalScope, engine);
|
|
|
|
|
|
|
|
|
|
CreateRanges createRanges(document(), doc);
|
|
|
|
|
createRanges(ast);
|
2010-11-29 09:54:27 +01:00
|
|
|
|
|
|
|
|
QTextCharFormat errorFormat;
|
|
|
|
|
errorFormat.setUnderlineStyle(QTextCharFormat::WaveUnderline);
|
|
|
|
|
errorFormat.setUnderlineColor(Qt::red);
|
|
|
|
|
|
|
|
|
|
QTextCharFormat warningFormat;
|
|
|
|
|
warningFormat.setUnderlineStyle(QTextCharFormat::WaveUnderline);
|
|
|
|
|
warningFormat.setUnderlineColor(Qt::darkYellow);
|
|
|
|
|
|
|
|
|
|
QList<QTextEdit::ExtraSelection> sels;
|
|
|
|
|
QSet<int> errors;
|
|
|
|
|
|
2010-11-29 17:21:47 +01:00
|
|
|
foreach (const DiagnosticMessage &m, engine->diagnosticMessages()) {
|
2010-11-29 09:54:27 +01:00
|
|
|
if (! m.line())
|
|
|
|
|
continue;
|
|
|
|
|
else if (errors.contains(m.line()))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
errors.insert(m.line());
|
|
|
|
|
|
|
|
|
|
QTextCursor cursor(document()->findBlockByNumber(m.line() - 1));
|
|
|
|
|
cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor);
|
|
|
|
|
|
|
|
|
|
QTextEdit::ExtraSelection sel;
|
|
|
|
|
sel.cursor = cursor;
|
|
|
|
|
sel.format = m.isError() ? errorFormat : warningFormat;
|
|
|
|
|
sel.format.setToolTip(m.message());
|
|
|
|
|
sels.append(sel);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setExtraSelections(CodeWarningsSelection, sels);
|
2010-11-29 17:21:47 +01:00
|
|
|
m_glslDocument = doc;
|
2010-11-19 14:59:33 +01:00
|
|
|
}
|
2010-11-10 14:01:09 +01:00
|
|
|
}
|
2010-11-26 15:14:33 +01:00
|
|
|
|
2014-08-22 17:16:02 +02:00
|
|
|
int languageVariant(const QString &type)
|
2010-11-26 15:14:33 +01:00
|
|
|
{
|
2010-12-01 11:49:36 +10:00
|
|
|
int variant = 0;
|
|
|
|
|
bool isVertex = false;
|
|
|
|
|
bool isFragment = false;
|
|
|
|
|
bool isDesktop = false;
|
|
|
|
|
if (type.isEmpty()) {
|
|
|
|
|
// ### Before file has been opened, so don't know the mime type.
|
|
|
|
|
isVertex = true;
|
|
|
|
|
isFragment = true;
|
|
|
|
|
} else if (type == QLatin1String("text/x-glsl") ||
|
|
|
|
|
type == QLatin1String("application/x-glsl")) {
|
|
|
|
|
isVertex = true;
|
|
|
|
|
isFragment = true;
|
|
|
|
|
isDesktop = true;
|
|
|
|
|
} else if (type == QLatin1String("text/x-glsl-vert")) {
|
|
|
|
|
isVertex = true;
|
|
|
|
|
isDesktop = true;
|
|
|
|
|
} else if (type == QLatin1String("text/x-glsl-frag")) {
|
|
|
|
|
isFragment = true;
|
|
|
|
|
isDesktop = true;
|
|
|
|
|
} else if (type == QLatin1String("text/x-glsl-es-vert")) {
|
|
|
|
|
isVertex = true;
|
|
|
|
|
} else if (type == QLatin1String("text/x-glsl-es-frag")) {
|
|
|
|
|
isFragment = true;
|
|
|
|
|
}
|
|
|
|
|
if (isDesktop)
|
|
|
|
|
variant |= Lexer::Variant_GLSL_120;
|
|
|
|
|
else
|
2010-12-01 12:30:07 +10:00
|
|
|
variant |= Lexer::Variant_GLSL_ES_100;
|
2010-12-01 11:49:36 +10:00
|
|
|
if (isVertex)
|
|
|
|
|
variant |= Lexer::Variant_VertexShader;
|
|
|
|
|
if (isFragment)
|
|
|
|
|
variant |= Lexer::Variant_FragmentShader;
|
|
|
|
|
return variant;
|
2010-11-26 15:14:33 +01:00
|
|
|
}
|
2010-11-29 17:21:47 +01:00
|
|
|
|
2014-09-04 00:04:18 +02:00
|
|
|
AssistInterface *GlslEditorWidget::createAssistInterface(
|
2014-08-19 22:20:55 +02:00
|
|
|
AssistKind kind, AssistReason reason) const
|
2011-04-15 16:19:23 +02:00
|
|
|
{
|
2014-08-19 22:20:55 +02:00
|
|
|
if (kind == Completion)
|
2014-08-21 08:29:55 +02:00
|
|
|
return new GlslCompletionAssistInterface(document(),
|
2011-04-15 16:19:23 +02:00
|
|
|
position(),
|
2014-09-01 18:09:07 +02:00
|
|
|
textDocument()->filePath(),
|
2011-04-15 16:19:23 +02:00
|
|
|
reason,
|
2014-08-01 23:31:56 +02:00
|
|
|
textDocument()->mimeType(),
|
2013-09-10 18:27:42 +02:00
|
|
|
m_glslDocument);
|
2011-04-15 16:19:23 +02:00
|
|
|
return BaseTextEditorWidget::createAssistInterface(kind, reason);
|
|
|
|
|
}
|
2014-08-19 22:20:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// GlslEditorFactory
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
GlslEditorFactory::GlslEditorFactory()
|
|
|
|
|
{
|
2014-08-22 17:16:02 +02:00
|
|
|
setId(Constants::C_GLSLEDITOR_ID);
|
|
|
|
|
setDisplayName(qApp->translate("OpenWith::Editors", Constants::C_GLSLEDITOR_DISPLAY_NAME));
|
|
|
|
|
addMimeType(Constants::GLSL_MIMETYPE);
|
|
|
|
|
addMimeType(Constants::GLSL_MIMETYPE_VERT);
|
|
|
|
|
addMimeType(Constants::GLSL_MIMETYPE_FRAG);
|
|
|
|
|
addMimeType(Constants::GLSL_MIMETYPE_VERT_ES);
|
|
|
|
|
addMimeType(Constants::GLSL_MIMETYPE_FRAG_ES);
|
|
|
|
|
|
2014-09-22 18:43:31 +02:00
|
|
|
setDocumentCreator([]() { return new TextDocument(Constants::C_GLSLEDITOR_ID); });
|
2014-08-22 17:16:02 +02:00
|
|
|
setEditorWidgetCreator([]() { return new GlslEditorWidget; });
|
|
|
|
|
setIndenterCreator([]() { return new GlslIndenter; });
|
2014-08-27 13:38:02 +02:00
|
|
|
setSyntaxHighlighterCreator([]() { return new GlslHighlighter; });
|
2014-09-01 16:16:44 +02:00
|
|
|
setCommentStyle(Utils::CommentDefinition::CppStyle);
|
2014-08-19 22:20:55 +02:00
|
|
|
|
2014-09-02 12:25:20 +02:00
|
|
|
setEditorActionHandlers(TextEditorActionHandler::Format
|
2014-08-22 17:16:02 +02:00
|
|
|
| TextEditorActionHandler::UnCommentSelection
|
|
|
|
|
| TextEditorActionHandler::UnCollapseAll);
|
2014-08-19 22:20:55 +02:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
2014-08-21 20:11:15 +02:00
|
|
|
} // namespace GlslEditor
|