QmlJSEditor: Remove functions from widget that delegate to document

Instead access document directly. Needs to export document.

Change-Id: I8fa86832982d2793ea951e88a5b6e3925b7cd281
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
Eike Ziller
2014-02-07 13:45:51 +01:00
parent 9167d4a16c
commit 89a2c4620b
11 changed files with 40 additions and 54 deletions

View File

@@ -29,6 +29,7 @@
#include "qmljshoverhandler.h"
#include "qmljseditor.h"
#include "qmljseditordocument.h"
#include "qmljseditoreditable.h"
#include "qmlexpressionundercursor.h"
@@ -194,8 +195,8 @@ void HoverHandler::identifyMatch(TextEditor::ITextEditor *editor, int pos)
if (!qmlEditor)
return;
const QmlJSTools::SemanticInfo &semanticInfo = qmlEditor->semanticInfo();
if (! semanticInfo.isValid() || qmlEditor->isSemanticInfoOutdated())
const QmlJSTools::SemanticInfo &semanticInfo = qmlEditor->qmlJsEditorDocument()->semanticInfo();
if (!semanticInfo.isValid() || qmlEditor->qmlJsEditorDocument()->isSemanticInfoOutdated())
return;
QList<AST::Node *> rangePath = semanticInfo.rangePath(pos);
@@ -266,7 +267,8 @@ bool HoverHandler::matchDiagnosticMessage(QmlJSTextEditorWidget *qmlEditor, int
return true;
}
}
foreach (const QTextLayout::FormatRange &range, qmlEditor->diagnosticRanges()) {
foreach (const QTextLayout::FormatRange &range,
qmlEditor->qmlJsEditorDocument()->diagnosticRanges()) {
if (pos >= range.start && pos < range.start+range.length) {
setToolTip(range.format.toolTip());
return true;