forked from qt-creator/qt-creator
Removed unused code.
This commit is contained in:
@@ -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())
|
||||
|
@@ -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>"));
|
||||
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user