diff --git a/src/plugins/qmleditor/qmlcodecompletion.cpp b/src/plugins/qmleditor/qmlcodecompletion.cpp index bd67c5c8b8345d2dfda532801b5e70b74c5ceadf..325467c16d250e78fd473ca2596a18d4640a8da1 100644 --- a/src/plugins/qmleditor/qmlcodecompletion.cpp +++ b/src/plugins/qmleditor/qmlcodecompletion.cpp @@ -90,18 +90,6 @@ int QmlCodeCompletion::startCompletion(TextEditor::ITextEditable *editor) m_startPosition = pos; m_completions.clear(); -// foreach (const QString &word, edit->keywords()) { -// TextEditor::CompletionItem item(this); -// item.m_text = word; -// m_completions.append(item); -// } -// -// foreach (const QString &word, edit->words()) { -// TextEditor::CompletionItem item(this); -// item.m_text = word; -// m_completions.append(item); -// } - QmlDocument::Ptr qmlDocument = edit->qmlDocument(); // qDebug() << "*** document:" << qmlDocument; if (qmlDocument.isNull()) diff --git a/src/plugins/qmleditor/qmleditor.cpp b/src/plugins/qmleditor/qmleditor.cpp index 60cfbbc2e88048cdcfa705f5d60d8dfbb2a27e9a..406420c6463131e6a6ff4fc685cfd9d5828aa44c 100644 --- a/src/plugins/qmleditor/qmleditor.cpp +++ b/src/plugins/qmleditor/qmleditor.cpp @@ -77,101 +77,6 @@ using namespace SharedTools; namespace QmlEditor { namespace Internal { -class FindWords: protected Visitor -{ -public: - QStringList operator()(AST::Node *node) - { - _words.clear(); - accept(node); - return QStringList(_words.toList()); - } - -protected: - void accept(AST::Node *node) - { AST::Node::acceptChild(node, this); } - - using Visitor::visit; - using Visitor::endVisit; - - void addWords(AST::UiQualifiedId *id) - { - for (; id; id = id->next) { - if (id->name) - _words.insert(id->name->asString()); - } - } - - virtual bool visit(AST::UiPublicMember *node) - { - if (node->name) - _words.insert(node->name->asString()); - - return true; - } - - virtual bool visit(AST::UiQualifiedId *node) - { - if (node->name) - _words.insert(node->name->asString()); - - return true; - } - - virtual bool visit(AST::IdentifierExpression *node) - { - if (node->name) - _words.insert(node->name->asString()); - - return true; - } - - virtual bool visit(AST::FieldMemberExpression *node) - { - if (node->name) - _words.insert(node->name->asString()); - - return true; - } - - virtual bool visit(AST::FunctionExpression *node) - { - if (node->name) - _words.insert(node->name->asString()); - - for (AST::FormalParameterList *it = node->formals; it; it = it->next) { - if (it->name) - _words.insert(it->name->asString()); - } - - return true; - } - - virtual bool visit(AST::FunctionDeclaration *node) - { - if (node->name) - _words.insert(node->name->asString()); - - for (AST::FormalParameterList *it = node->formals; it; it = it->next) { - if (it->name) - _words.insert(it->name->asString()); - } - - return true; - } - - virtual bool visit(AST::VariableDeclaration *node) - { - if (node->name) - _words.insert(node->name->asString()); - - return true; - } - -private: - QSet<QString> _words; -}; - class FindIdDeclarations: protected Visitor { public: @@ -415,9 +320,6 @@ ScriptEditor::~ScriptEditor() QList<Declaration> ScriptEditor::declarations() const { return m_declarations; } -QStringList ScriptEditor::words() const -{ return m_words; } - Core::IEditor *ScriptEditorEditable::duplicate(QWidget *parent) { ScriptEditor *newEditor = new ScriptEditor(parent); @@ -466,9 +368,6 @@ void ScriptEditor::onDocumentUpdated(QmlEditor::QmlDocument::Ptr doc) FindDeclarations findDeclarations; m_declarations = findDeclarations(doc->program()); - FindWords findWords; - m_words = findWords(doc->program()); - QStringList items; items.append(tr("<Select Symbol>")); diff --git a/src/plugins/qmleditor/qmleditor.h b/src/plugins/qmleditor/qmleditor.h index a29110039b3384183611f2e78967dcbbf9ce986f..7746ddf82d9c2bb75cacf130ab4bbac310a84f06 100644 --- a/src/plugins/qmleditor/qmleditor.h +++ b/src/plugins/qmleditor/qmleditor.h @@ -101,7 +101,6 @@ public: ~ScriptEditor(); QList<Declaration> declarations() const; - QStringList words() const; QStringList keywords() const; QList<QmlJS::DiagnosticMessage> diagnosticMessages() const @@ -145,7 +144,6 @@ private: QTimer *m_updateDocumentTimer; QComboBox *m_methodCombo; QList<Declaration> m_declarations; - QStringList m_words; QMap<QString, QList<QmlJS::AST::SourceLocation> > m_ids; // ### use QMultiMap QList<QmlJS::DiagnosticMessage> m_diagnosticMessages; QmlDocument::Ptr m_document;