QmlJS: Add initial 'Find Usages' support.

This commit is contained in:
Christian Kamm
2010-09-24 14:05:34 +02:00
parent 6755edc351
commit 3f505e9982
20 changed files with 967 additions and 142 deletions

View File

@@ -35,6 +35,7 @@
#include "qmljseditorcodeformatter.h"
#include "qmljsquickfix.h"
#include "qmloutlinemodel.h"
#include "qmljsfindreferences.h"
#include <qmljs/qmljsbind.h>
#include <qmljs/qmljscheck.h>
@@ -676,7 +677,8 @@ QmlJSTextEditor::QmlJSTextEditor(QWidget *parent) :
m_outlineModel(new QmlOutlineModel(this)),
m_modelManager(0),
m_contextPane(0),
m_updateSelectedElements(false)
m_updateSelectedElements(false),
m_findReferences(new FindReferences(this))
{
qRegisterMetaType<QmlJSEditor::Internal::SemanticInfo>("QmlJSEditor::Internal::SemanticInfo");
@@ -1434,6 +1436,11 @@ void QmlJSTextEditor::followSymbolUnderCursor()
openLink(findLinkAt(textCursor()));
}
void QmlJSTextEditor::findUsages()
{
m_findReferences->findUsages(file()->fileName(), textCursor().position());
}
void QmlJSTextEditor::showContextPane()
{
if (m_contextPane) {