forked from qt-creator/qt-creator
QmlDesigner: Remove unneeded qualifications
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
next if file =~ %r{src/shared/qbs|/qmljs/}
s = File.read(file)
s.scan(/^using namespace (.*);$/) {
ns = $1
t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
before = $1
char = $2
if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
m
else
before + char
end
}
if t != s
puts file
File.open(file, 'w').write(t)
end
}
}
Change-Id: I492792bb9e5655c55795e938031efc557c9a462f
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
42af154c77
commit
b6de2d1bd8
@@ -125,7 +125,7 @@ QmlExpressionUnderCursor::QmlExpressionUnderCursor()
|
||||
: _expressionNode(0), _expressionOffset(0), _expressionLength(0)
|
||||
{}
|
||||
|
||||
QmlJS::AST::ExpressionNode *QmlExpressionUnderCursor::operator()(const QTextCursor &cursor)
|
||||
ExpressionNode *QmlExpressionUnderCursor::operator()(const QTextCursor &cursor)
|
||||
{
|
||||
_expressionNode = 0;
|
||||
_expressionOffset = -1;
|
||||
@@ -152,4 +152,3 @@ ExpressionNode *QmlExpressionUnderCursor::expressionNode() const
|
||||
{
|
||||
return _expressionNode;
|
||||
}
|
||||
|
||||
|
||||
@@ -651,7 +651,7 @@ IAssistProposal *QmlJSCompletionAssistProcessor::perform(const AssistInterface *
|
||||
|
||||
// currently path-in-stringliteral is the only completion available in imports
|
||||
if (contextFinder.isInImport()) {
|
||||
QmlJS::ModelManagerInterface::ProjectInfo pInfo = QmlJS::ModelManagerInterface::instance()
|
||||
ModelManagerInterface::ProjectInfo pInfo = ModelManagerInterface::instance()
|
||||
->projectInfo(ProjectExplorer::ProjectTree::currentProject());
|
||||
QmlBundle platform = pInfo.extendedBundle.bundleForLanguage(document->language());
|
||||
if (!platform.supportedImports().isEmpty()) {
|
||||
@@ -661,8 +661,8 @@ IAssistProposal *QmlJSCompletionAssistProcessor::perform(const AssistInterface *
|
||||
expressionUnderCursor(tc);
|
||||
QString libVersion = contextFinder.libVersionImport();
|
||||
if (!libVersion.isNull()) {
|
||||
QStringList completions=platform.supportedImports().complete(libVersion, QString(), QmlJS::PersistentTrie::LookupFlags(QmlJS::PersistentTrie::CaseInsensitive|QmlJS::PersistentTrie::SkipChars|QmlJS::PersistentTrie::SkipSpaces));
|
||||
completions = QmlJS::PersistentTrie::matchStrengthSort(libVersion, completions);
|
||||
QStringList completions=platform.supportedImports().complete(libVersion, QString(), PersistentTrie::LookupFlags(PersistentTrie::CaseInsensitive|PersistentTrie::SkipChars|PersistentTrie::SkipSpaces));
|
||||
completions = PersistentTrie::matchStrengthSort(libVersion, completions);
|
||||
|
||||
int toSkip = qMax(libVersion.lastIndexOf(QLatin1Char(' '))
|
||||
, libVersion.lastIndexOf(QLatin1Char('.')));
|
||||
@@ -691,7 +691,7 @@ IAssistProposal *QmlJSCompletionAssistProcessor::perform(const AssistInterface *
|
||||
tc.setPosition(m_startPosition - 1);
|
||||
|
||||
QmlExpressionUnderCursor expressionUnderCursor;
|
||||
QmlJS::AST::ExpressionNode *expression = expressionUnderCursor(tc);
|
||||
AST::ExpressionNode *expression = expressionUnderCursor(tc);
|
||||
|
||||
if (expression != 0 && ! isLiteral(expression)) {
|
||||
// Evaluate the expression under cursor.
|
||||
|
||||
@@ -134,8 +134,8 @@ void QmlJSEditorWidget::finalizeInitialization()
|
||||
|
||||
textDocument()->setCodec(QTextCodec::codecForName("UTF-8")); // qml files are defined to be utf-8
|
||||
|
||||
m_modelManager = QmlJS::ModelManagerInterface::instance();
|
||||
m_contextPane = ExtensionSystem::PluginManager::getObject<QmlJS::IContextPane>();
|
||||
m_modelManager = ModelManagerInterface::instance();
|
||||
m_contextPane = ExtensionSystem::PluginManager::getObject<IContextPane>();
|
||||
|
||||
m_modelManager->activateScan();
|
||||
|
||||
@@ -207,7 +207,7 @@ static void appendExtraSelectionsForMessages(
|
||||
}
|
||||
}
|
||||
|
||||
void QmlJSEditorWidget::updateCodeWarnings(QmlJS::Document::Ptr doc)
|
||||
void QmlJSEditorWidget::updateCodeWarnings(Document::Ptr doc)
|
||||
{
|
||||
if (doc->ast()) {
|
||||
setExtraSelections(CodeWarningsSelection, QList<QTextEdit::ExtraSelection>());
|
||||
@@ -348,7 +348,7 @@ void QmlJSEditorWidget::updateUses()
|
||||
continue;
|
||||
|
||||
QTextEdit::ExtraSelection sel;
|
||||
sel.format = textDocument()->fontSettings().toTextCharFormat(TextEditor::C_OCCURRENCES);
|
||||
sel.format = textDocument()->fontSettings().toTextCharFormat(C_OCCURRENCES);
|
||||
sel.cursor = textCursor();
|
||||
sel.cursor.setPosition(loc.begin());
|
||||
sel.cursor.setPosition(loc.end(), QTextCursor::KeepAnchor);
|
||||
@@ -791,7 +791,7 @@ void QmlJSEditorWidget::semanticInfoUpdated(const SemanticInfo &semanticInfo)
|
||||
if (m_firstSementicInfo) {
|
||||
m_firstSementicInfo = false;
|
||||
if (semanticInfo.document->language() == Dialect::QmlQtQuick2Ui) {
|
||||
Core::InfoBarEntry info(Core::Id(Constants::QML_UI_FILE_WARNING),
|
||||
InfoBarEntry info(Id(Constants::QML_UI_FILE_WARNING),
|
||||
tr("This file should only be edited in <b>Design</b> mode."));
|
||||
info.setCustomButtonInfo(tr("Switch Mode"), []() { ModeManager::activateMode(Core::Constants::MODE_DESIGN); });
|
||||
textDocument()->infoBar()->addInfo(info);
|
||||
@@ -840,16 +840,16 @@ bool QmlJSEditorWidget::hideContextPane()
|
||||
}
|
||||
|
||||
AssistInterface *QmlJSEditorWidget::createAssistInterface(
|
||||
TextEditor::AssistKind assistKind,
|
||||
TextEditor::AssistReason reason) const
|
||||
AssistKind assistKind,
|
||||
AssistReason reason) const
|
||||
{
|
||||
if (assistKind == TextEditor::Completion) {
|
||||
if (assistKind == Completion) {
|
||||
return new QmlJSCompletionAssistInterface(document(),
|
||||
position(),
|
||||
textDocument()->filePath().toString(),
|
||||
reason,
|
||||
m_qmlJsEditorDocument->semanticInfo());
|
||||
} else if (assistKind == TextEditor::QuickFix) {
|
||||
} else if (assistKind == QuickFix) {
|
||||
return new QmlJSQuickFixAssistInterface(const_cast<QmlJSEditorWidget *>(this), reason);
|
||||
}
|
||||
return 0;
|
||||
@@ -868,7 +868,7 @@ QString QmlJSEditorWidget::foldReplacementText(const QTextBlock &block) const
|
||||
return QLatin1String("id: ") + objectId + QLatin1String("...");
|
||||
}
|
||||
|
||||
return TextEditor::TextEditorWidget::foldReplacementText(block);
|
||||
return TextEditorWidget::foldReplacementText(block);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -89,8 +89,8 @@ QmlJSEditorPlugin::QmlJSEditorPlugin() :
|
||||
m_reformatFileAction(0),
|
||||
m_currentDocument(0),
|
||||
m_jsonManager(new Utils::JsonSchemaManager(
|
||||
QStringList() << Core::ICore::userResourcePath() + QLatin1String("/json/")
|
||||
<< Core::ICore::resourcePath() + QLatin1String("/json/")))
|
||||
QStringList() << ICore::userResourcePath() + QLatin1String("/json/")
|
||||
<< ICore::resourcePath() + QLatin1String("/json/")))
|
||||
{
|
||||
m_instance = this;
|
||||
}
|
||||
@@ -119,63 +119,63 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
|
||||
connect(m_modelManager, SIGNAL(aboutToRemoveFiles(QStringList)),
|
||||
m_qmlTaskManager, SLOT(documentsRemoved(QStringList)));
|
||||
|
||||
Core::Context context(Constants::C_QMLJSEDITOR_ID);
|
||||
Context context(Constants::C_QMLJSEDITOR_ID);
|
||||
|
||||
addAutoReleasedObject(new QmlJSEditorFactory);
|
||||
|
||||
Core::ActionContainer *contextMenu = Core::ActionManager::createMenu(Constants::M_CONTEXT);
|
||||
Core::ActionContainer *qmlToolsMenu = Core::ActionManager::actionContainer(Core::Id(QmlJSTools::Constants::M_TOOLS_QMLJS));
|
||||
ActionContainer *contextMenu = ActionManager::createMenu(Constants::M_CONTEXT);
|
||||
ActionContainer *qmlToolsMenu = ActionManager::actionContainer(Id(QmlJSTools::Constants::M_TOOLS_QMLJS));
|
||||
|
||||
Core::Context globalContext(Core::Constants::C_GLOBAL);
|
||||
Context globalContext(Core::Constants::C_GLOBAL);
|
||||
qmlToolsMenu->addSeparator(globalContext);
|
||||
|
||||
Core::Command *cmd;
|
||||
cmd = Core::ActionManager::command(TextEditor::Constants::FOLLOW_SYMBOL_UNDER_CURSOR);
|
||||
Command *cmd;
|
||||
cmd = ActionManager::command(TextEditor::Constants::FOLLOW_SYMBOL_UNDER_CURSOR);
|
||||
contextMenu->addAction(cmd);
|
||||
qmlToolsMenu->addAction(cmd);
|
||||
|
||||
QAction *findUsagesAction = new QAction(tr("Find Usages"), this);
|
||||
cmd = Core::ActionManager::registerAction(findUsagesAction, Constants::FIND_USAGES, context);
|
||||
cmd = ActionManager::registerAction(findUsagesAction, Constants::FIND_USAGES, context);
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+U")));
|
||||
connect(findUsagesAction, SIGNAL(triggered()), this, SLOT(findUsages()));
|
||||
contextMenu->addAction(cmd);
|
||||
qmlToolsMenu->addAction(cmd);
|
||||
|
||||
QAction *renameUsagesAction = new QAction(tr("Rename Symbol Under Cursor"), this);
|
||||
cmd = Core::ActionManager::registerAction(renameUsagesAction, Constants::RENAME_USAGES, context);
|
||||
cmd = ActionManager::registerAction(renameUsagesAction, Constants::RENAME_USAGES, context);
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+R")));
|
||||
connect(renameUsagesAction, SIGNAL(triggered()), this, SLOT(renameUsages()));
|
||||
contextMenu->addAction(cmd);
|
||||
qmlToolsMenu->addAction(cmd);
|
||||
|
||||
QAction *semanticScan = new QAction(tr("Run Checks"), this);
|
||||
cmd = Core::ActionManager::registerAction(semanticScan, Core::Id(Constants::RUN_SEMANTIC_SCAN), globalContext);
|
||||
cmd = ActionManager::registerAction(semanticScan, Id(Constants::RUN_SEMANTIC_SCAN), globalContext);
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+C")));
|
||||
connect(semanticScan, SIGNAL(triggered()), this, SLOT(runSemanticScan()));
|
||||
qmlToolsMenu->addAction(cmd);
|
||||
|
||||
m_reformatFileAction = new QAction(tr("Reformat File"), this);
|
||||
cmd = Core::ActionManager::registerAction(m_reformatFileAction, Core::Id(Constants::REFORMAT_FILE), context);
|
||||
cmd = ActionManager::registerAction(m_reformatFileAction, Id(Constants::REFORMAT_FILE), context);
|
||||
connect(m_reformatFileAction, SIGNAL(triggered()), this, SLOT(reformatFile()));
|
||||
qmlToolsMenu->addAction(cmd);
|
||||
|
||||
QAction *showQuickToolbar = new QAction(tr("Show Qt Quick Toolbar"), this);
|
||||
cmd = Core::ActionManager::registerAction(showQuickToolbar, Constants::SHOW_QT_QUICK_HELPER, context);
|
||||
cmd->setDefaultKeySequence(Core::UseMacShortcuts ? QKeySequence(Qt::META + Qt::ALT + Qt::Key_Space)
|
||||
cmd = ActionManager::registerAction(showQuickToolbar, Constants::SHOW_QT_QUICK_HELPER, context);
|
||||
cmd->setDefaultKeySequence(UseMacShortcuts ? QKeySequence(Qt::META + Qt::ALT + Qt::Key_Space)
|
||||
: QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Space));
|
||||
connect(showQuickToolbar, SIGNAL(triggered()), this, SLOT(showContextPane()));
|
||||
contextMenu->addAction(cmd);
|
||||
qmlToolsMenu->addAction(cmd);
|
||||
|
||||
// Insert marker for "Refactoring" menu:
|
||||
Core::Command *sep = contextMenu->addSeparator(globalContext);
|
||||
Command *sep = contextMenu->addSeparator(globalContext);
|
||||
sep->action()->setObjectName(QLatin1String(Constants::M_REFACTORING_MENU_INSERTION_POINT));
|
||||
contextMenu->addSeparator(globalContext);
|
||||
|
||||
cmd = Core::ActionManager::command(TextEditor::Constants::AUTO_INDENT_SELECTION);
|
||||
cmd = ActionManager::command(TextEditor::Constants::AUTO_INDENT_SELECTION);
|
||||
contextMenu->addAction(cmd);
|
||||
|
||||
cmd = Core::ActionManager::command(TextEditor::Constants::UN_COMMENT_SELECTION);
|
||||
cmd = ActionManager::command(TextEditor::Constants::UN_COMMENT_SELECTION);
|
||||
contextMenu->addAction(cmd);
|
||||
|
||||
m_quickFixAssistProvider = new QmlJSQuickFixAssistProvider;
|
||||
@@ -183,14 +183,14 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
|
||||
|
||||
errorMessage->clear();
|
||||
|
||||
Core::FileIconProvider::registerIconOverlayForSuffix(":/qmljseditor/images/qmlfile.png", "qml");
|
||||
FileIconProvider::registerIconOverlayForSuffix(":/qmljseditor/images/qmlfile.png", "qml");
|
||||
|
||||
registerQuickFixes(this);
|
||||
|
||||
addAutoReleasedObject(new QmlJSOutlineWidgetFactory);
|
||||
|
||||
addAutoReleasedObject(new QuickToolBar);
|
||||
addAutoReleasedObject(new Internal::QuickToolBarSettingsPage);
|
||||
addAutoReleasedObject(new QuickToolBarSettingsPage);
|
||||
|
||||
connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)), SLOT(currentEditorChanged(Core::IEditor*)));
|
||||
|
||||
@@ -217,13 +217,13 @@ Utils::JsonSchemaManager *QmlJSEditorPlugin::jsonManager() const
|
||||
|
||||
void QmlJSEditorPlugin::findUsages()
|
||||
{
|
||||
if (QmlJSEditorWidget *editor = qobject_cast<QmlJSEditorWidget*>(Core::EditorManager::currentEditor()->widget()))
|
||||
if (QmlJSEditorWidget *editor = qobject_cast<QmlJSEditorWidget*>(EditorManager::currentEditor()->widget()))
|
||||
editor->findUsages();
|
||||
}
|
||||
|
||||
void QmlJSEditorPlugin::renameUsages()
|
||||
{
|
||||
if (QmlJSEditorWidget *editor = qobject_cast<QmlJSEditorWidget*>(Core::EditorManager::currentEditor()->widget()))
|
||||
if (QmlJSEditorWidget *editor = qobject_cast<QmlJSEditorWidget*>(EditorManager::currentEditor()->widget()))
|
||||
editor->renameUsages();
|
||||
}
|
||||
|
||||
@@ -242,15 +242,15 @@ void QmlJSEditorPlugin::reformatFile()
|
||||
|
||||
void QmlJSEditorPlugin::showContextPane()
|
||||
{
|
||||
if (QmlJSEditorWidget *editor = qobject_cast<QmlJSEditorWidget*>(Core::EditorManager::currentEditor()->widget()))
|
||||
if (QmlJSEditorWidget *editor = qobject_cast<QmlJSEditorWidget*>(EditorManager::currentEditor()->widget()))
|
||||
editor->showContextPane();
|
||||
}
|
||||
|
||||
Core::Command *QmlJSEditorPlugin::addToolAction(QAction *a,
|
||||
Core::Context &context, Core::Id id,
|
||||
Core::ActionContainer *c1, const QString &keySequence)
|
||||
Command *QmlJSEditorPlugin::addToolAction(QAction *a,
|
||||
Context &context, Id id,
|
||||
ActionContainer *c1, const QString &keySequence)
|
||||
{
|
||||
Core::Command *command = Core::ActionManager::registerAction(a, id, context);
|
||||
Command *command = ActionManager::registerAction(a, id, context);
|
||||
if (!keySequence.isEmpty())
|
||||
command->setDefaultKeySequence(QKeySequence(keySequence));
|
||||
c1->addAction(command);
|
||||
@@ -262,7 +262,7 @@ QmlJSQuickFixAssistProvider *QmlJSEditorPlugin::quickFixAssistProvider() const
|
||||
return m_quickFixAssistProvider;
|
||||
}
|
||||
|
||||
void QmlJSEditorPlugin::currentEditorChanged(Core::IEditor *editor)
|
||||
void QmlJSEditorPlugin::currentEditorChanged(IEditor *editor)
|
||||
{
|
||||
QmlJSEditorDocument *document = 0;
|
||||
if (editor)
|
||||
|
||||
@@ -834,7 +834,7 @@ static void find_helper(QFutureInterface<FindReferences::Usage> &future,
|
||||
if (!doc)
|
||||
return;
|
||||
|
||||
QmlJS::ModelManagerInterface *modelManager = QmlJS::ModelManagerInterface::instance();
|
||||
ModelManagerInterface *modelManager = ModelManagerInterface::instance();
|
||||
|
||||
Link link(snapshot, modelManager->defaultVContext(doc->language(), doc), modelManager->builtins(doc));
|
||||
ContextPtr context = link();
|
||||
@@ -957,12 +957,12 @@ void FindReferences::displayResults(int first, int last)
|
||||
const QString label = tr("QML/JS Usages:");
|
||||
|
||||
if (replacement.isEmpty()) {
|
||||
m_currentSearch = Core::SearchResultWindow::instance()->startNewSearch(
|
||||
label, QString(), symbolName, Core::SearchResultWindow::SearchOnly);
|
||||
m_currentSearch = SearchResultWindow::instance()->startNewSearch(
|
||||
label, QString(), symbolName, SearchResultWindow::SearchOnly);
|
||||
} else {
|
||||
m_currentSearch = Core::SearchResultWindow::instance()->startNewSearch(
|
||||
label, QString(), symbolName, Core::SearchResultWindow::SearchAndReplace,
|
||||
Core::SearchResultWindow::PreserveCaseDisabled);
|
||||
m_currentSearch = SearchResultWindow::instance()->startNewSearch(
|
||||
label, QString(), symbolName, SearchResultWindow::SearchAndReplace,
|
||||
SearchResultWindow::PreserveCaseDisabled);
|
||||
m_currentSearch->setTextToReplace(replacement);
|
||||
connect(m_currentSearch, SIGNAL(replaceButtonClicked(QString,QList<Core::SearchResultItem>,bool)),
|
||||
SLOT(onReplaceButtonClicked(QString,QList<Core::SearchResultItem>,bool)));
|
||||
@@ -971,7 +971,7 @@ void FindReferences::displayResults(int first, int last)
|
||||
this, SLOT(openEditor(Core::SearchResultItem)));
|
||||
connect(m_currentSearch, SIGNAL(cancelled()), this, SLOT(cancel()));
|
||||
connect(m_currentSearch, SIGNAL(paused(bool)), this, SLOT(setPaused(bool)));
|
||||
Core::SearchResultWindow::instance()->popup(IOutputPane::Flags(IOutputPane::ModeSwitch | IOutputPane::WithFocus));
|
||||
SearchResultWindow::instance()->popup(IOutputPane::Flags(IOutputPane::ModeSwitch | IOutputPane::WithFocus));
|
||||
|
||||
FutureProgress *progress = ProgressManager::addTask(
|
||||
m_watcher.future(), tr("Searching for Usages"),
|
||||
@@ -1014,7 +1014,7 @@ void FindReferences::setPaused(bool paused)
|
||||
m_watcher.setPaused(paused);
|
||||
}
|
||||
|
||||
void FindReferences::openEditor(const Core::SearchResultItem &item)
|
||||
void FindReferences::openEditor(const SearchResultItem &item)
|
||||
{
|
||||
if (item.path.size() > 0) {
|
||||
EditorManager::openEditorAt(QDir::fromNativeSeparators(item.path.first()),
|
||||
@@ -1024,7 +1024,7 @@ void FindReferences::openEditor(const Core::SearchResultItem &item)
|
||||
}
|
||||
}
|
||||
|
||||
void FindReferences::onReplaceButtonClicked(const QString &text, const QList<Core::SearchResultItem> &items, bool preserveCase)
|
||||
void FindReferences::onReplaceButtonClicked(const QString &text, const QList<SearchResultItem> &items, bool preserveCase)
|
||||
{
|
||||
const QStringList fileNames = TextEditor::BaseFileFind::replaceAll(text, items, preserveCase);
|
||||
|
||||
@@ -1039,9 +1039,9 @@ void FindReferences::onReplaceButtonClicked(const QString &text, const QList<Cor
|
||||
}
|
||||
|
||||
if (!changedOnDisk.isEmpty())
|
||||
QmlJS::ModelManagerInterface::instance()->updateSourceFiles(changedOnDisk, true);
|
||||
ModelManagerInterface::instance()->updateSourceFiles(changedOnDisk, true);
|
||||
if (!changedUnsavedEditors.isEmpty())
|
||||
QmlJS::ModelManagerInterface::instance()->updateSourceFiles(changedUnsavedEditors, false);
|
||||
ModelManagerInterface::instance()->updateSourceFiles(changedUnsavedEditors, false);
|
||||
|
||||
Core::SearchResultWindow::instance()->hide();
|
||||
SearchResultWindow::instance()->hide();
|
||||
}
|
||||
|
||||
@@ -47,15 +47,15 @@ QmlJSHighlighter::QmlJSHighlighter(QTextDocument *parent)
|
||||
m_inMultilineComment(false)
|
||||
{
|
||||
m_currentBlockParentheses.reserve(20);
|
||||
static QVector<TextEditor::TextStyle> categories;
|
||||
static QVector<TextStyle> categories;
|
||||
if (categories.isEmpty()) {
|
||||
categories << TextEditor::C_NUMBER
|
||||
<< TextEditor::C_STRING
|
||||
<< TextEditor::C_TYPE
|
||||
<< TextEditor::C_KEYWORD
|
||||
<< TextEditor::C_FIELD
|
||||
<< TextEditor::C_COMMENT
|
||||
<< TextEditor::C_VISUAL_WHITESPACE;
|
||||
categories << C_NUMBER
|
||||
<< C_STRING
|
||||
<< C_TYPE
|
||||
<< C_KEYWORD
|
||||
<< C_FIELD
|
||||
<< C_COMMENT
|
||||
<< C_VISUAL_WHITESPACE;
|
||||
}
|
||||
setTextFormatCategories(categories);
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace {
|
||||
|
||||
QmlJSHoverHandler::QmlJSHoverHandler() : m_modelManager(0)
|
||||
{
|
||||
m_modelManager = QmlJS::ModelManagerInterface::instance();
|
||||
m_modelManager = ModelManagerInterface::instance();
|
||||
}
|
||||
|
||||
static inline QString getModuleName(const ScopeChain &scopeChain, const Document::Ptr &qmlDocument,
|
||||
@@ -377,8 +377,8 @@ void QmlJSHoverHandler::operateTooltip(TextEditorWidget *editorWidget, const QPo
|
||||
Utils::ToolTip::show(point, toolTip(), editorWidget);
|
||||
}
|
||||
|
||||
void QmlJSHoverHandler::prettyPrintTooltip(const QmlJS::Value *value,
|
||||
const QmlJS::ContextPtr &context)
|
||||
void QmlJSHoverHandler::prettyPrintTooltip(const Value *value,
|
||||
const ContextPtr &context)
|
||||
{
|
||||
if (! value)
|
||||
return;
|
||||
|
||||
@@ -57,7 +57,7 @@ QmlJSQuickFixOperation::QmlJSQuickFixOperation(const QmlJSQuickFixInterface &int
|
||||
|
||||
void QmlJSQuickFixOperation::perform()
|
||||
{
|
||||
QmlJSRefactoringChanges refactoring(QmlJS::ModelManagerInterface::instance(),
|
||||
QmlJSRefactoringChanges refactoring(ModelManagerInterface::instance(),
|
||||
m_interface->semanticInfo().snapshot);
|
||||
QmlJSRefactoringFilePtr current = refactoring.file(fileName());
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ using namespace Internal;
|
||||
// QuickFixAssistInterface
|
||||
// -----------------------
|
||||
QmlJSQuickFixAssistInterface::QmlJSQuickFixAssistInterface(QmlJSEditorWidget *editor,
|
||||
TextEditor::AssistReason reason)
|
||||
AssistReason reason)
|
||||
: AssistInterface(editor->document(), editor->position(),
|
||||
editor->textDocument()->filePath().toString(), reason)
|
||||
, m_semanticInfo(editor->qmlJsEditorDocument()->semanticInfo())
|
||||
@@ -94,7 +94,7 @@ IAssistProcessor *QmlJSQuickFixAssistProvider::createProcessor() const
|
||||
|
||||
QList<QuickFixFactory *> QmlJSQuickFixAssistProvider::quickFixFactories() const
|
||||
{
|
||||
QList<TextEditor::QuickFixFactory *> results;
|
||||
QList<QuickFixFactory *> results;
|
||||
foreach (QmlJSQuickFixFactory *f, ExtensionSystem::PluginManager::getObjects<QmlJSQuickFixFactory>())
|
||||
results.append(f);
|
||||
return results;
|
||||
|
||||
@@ -70,12 +70,12 @@ class SplitInitializerOp: public QmlJSQuickFixFactory
|
||||
|
||||
const int pos = interface->currentFile()->cursor().position();
|
||||
|
||||
if (QmlJS::AST::Node *member = interface->semanticInfo().rangeAt(pos)) {
|
||||
if (QmlJS::AST::UiObjectBinding *b = QmlJS::AST::cast<QmlJS::AST::UiObjectBinding *>(member)) {
|
||||
if (Node *member = interface->semanticInfo().rangeAt(pos)) {
|
||||
if (UiObjectBinding *b = AST::cast<UiObjectBinding *>(member)) {
|
||||
if (b->initializer->lbraceToken.startLine == b->initializer->rbraceToken.startLine)
|
||||
objectInitializer = b->initializer;
|
||||
|
||||
} else if (QmlJS::AST::UiObjectDefinition *b = QmlJS::AST::cast<QmlJS::AST::UiObjectDefinition *>(member)) {
|
||||
} else if (UiObjectDefinition *b = AST::cast<UiObjectDefinition *>(member)) {
|
||||
if (b->initializer->lbraceToken.startLine == b->initializer->rbraceToken.startLine)
|
||||
objectInitializer = b->initializer;
|
||||
}
|
||||
@@ -106,9 +106,9 @@ class SplitInitializerOp: public QmlJSQuickFixFactory
|
||||
|
||||
Utils::ChangeSet changes;
|
||||
|
||||
for (QmlJS::AST::UiObjectMemberList *it = _objectInitializer->members; it; it = it->next) {
|
||||
if (QmlJS::AST::UiObjectMember *member = it->member) {
|
||||
const QmlJS::AST::SourceLocation loc = member->firstSourceLocation();
|
||||
for (UiObjectMemberList *it = _objectInitializer->members; it; it = it->next) {
|
||||
if (UiObjectMember *member = it->member) {
|
||||
const SourceLocation loc = member->firstSourceLocation();
|
||||
|
||||
// insert a newline at the beginning of this binding
|
||||
changes.insert(currentFile->startOf(loc), QLatin1String("\n"));
|
||||
|
||||
@@ -363,7 +363,7 @@ protected:
|
||||
return false;
|
||||
}
|
||||
|
||||
void addMessages(QList<QmlJS::DiagnosticMessage> messages,
|
||||
void addMessages(QList<DiagnosticMessage> messages,
|
||||
const Document::Ptr &doc)
|
||||
{
|
||||
foreach (const DiagnosticMessage &d, messages) {
|
||||
@@ -399,10 +399,10 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
void addMessages(const QList<QmlJS::StaticAnalysis::Message> &messages,
|
||||
void addMessages(const QList<StaticAnalysis::Message> &messages,
|
||||
const Document::Ptr &doc)
|
||||
{
|
||||
foreach (const QmlJS::StaticAnalysis::Message &d, messages) {
|
||||
foreach (const StaticAnalysis::Message &d, messages) {
|
||||
int line = d.location.startLine;
|
||||
int column = qMax(1U, d.location.startColumn);
|
||||
int length = d.location.length;
|
||||
|
||||
@@ -79,7 +79,7 @@ static inline const ObjectValue * getPropertyChangesTarget(Node *node, const Sco
|
||||
}
|
||||
|
||||
QuickToolBar::QuickToolBar(QObject *parent)
|
||||
: ::QmlJS::IContextPane(parent)
|
||||
: ::IContextPane(parent)
|
||||
, m_editorWidget(0)
|
||||
, m_blockWriting(false)
|
||||
{
|
||||
@@ -116,7 +116,7 @@ QuickToolBar::~QuickToolBar()
|
||||
m_widget = 0;
|
||||
}
|
||||
|
||||
void QuickToolBar::apply(TextEditor::TextEditorWidget *editorWidget, Document::Ptr document, const ScopeChain *scopeChain, AST::Node *node, bool update, bool force)
|
||||
void QuickToolBar::apply(TextEditor::TextEditorWidget *editorWidget, Document::Ptr document, const ScopeChain *scopeChain, Node *node, bool update, bool force)
|
||||
{
|
||||
if (!QuickToolBarSettings::get().enableContextPane && !force && !update) {
|
||||
contextWidget()->hide();
|
||||
@@ -246,7 +246,7 @@ void QuickToolBar::apply(TextEditor::TextEditorWidget *editorWidget, Document::P
|
||||
|
||||
}
|
||||
|
||||
bool QuickToolBar::isAvailable(TextEditor::TextEditorWidget *, Document::Ptr document, AST::Node *node)
|
||||
bool QuickToolBar::isAvailable(TextEditor::TextEditorWidget *, Document::Ptr document, Node *node)
|
||||
{
|
||||
if (document.isNull())
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user