virtual int indentDepth() const
{ return 0; }
- virtual QmlJS::Snapshot getSnapshot() const
- { return QmlJS::Snapshot(); }
+ virtual QmlJS::Snapshot getSnapshot() const;
- virtual QStringList importPaths() const
- { return QStringList(); }
+ virtual QStringList importPaths() const;
};
}
#include "plaintexteditmodifier.h"
#include <utils/changeset.h>
+#include <extensionsystem/pluginmanager.h>
+#include <qmljs/qmljsmodelmanagerinterface.h>
#include <QtGui/QPlainTextEdit>
#include <QtGui/QUndoStack>
emit textChanged();
}
}
+
+namespace {
+static inline QmlJS::ModelManagerInterface *getModelManager()
+{
+ ExtensionSystem::PluginManager *pluginManager = ExtensionSystem::PluginManager::instance();
+ return pluginManager->getObject<QmlJS::ModelManagerInterface>();
+}
+}
+
+QmlJS::Snapshot NotIndentingTextEditModifier::getSnapshot() const
+{
+ QmlJS::ModelManagerInterface *modelManager = getModelManager();
+ if (modelManager)
+ return modelManager->snapshot();
+ else
+ return QmlJS::Snapshot();
+}
+
+
+QStringList NotIndentingTextEditModifier::importPaths() const
+{
+ QmlJS::ModelManagerInterface *modelManager = getModelManager();
+ if (modelManager)
+ return modelManager->importPaths();
+ else
+ return QStringList();
+}