forked from qt-creator/qt-creator
QmlJS: Allow lookups on const Contexts. Pass const Contexts where ok.
In preparation for caching Contexts. Reviewed-by: Erik Verbruggen
This commit is contained in:
@@ -168,11 +168,11 @@ class EnumerateProperties: private Interpreter::MemberProcessor
|
||||
QHash<QString, const Interpreter::Value *> _properties;
|
||||
bool _globalCompletion;
|
||||
bool _enumerateGeneratedSlots;
|
||||
Interpreter::Context *_context;
|
||||
const Interpreter::Context *_context;
|
||||
const Interpreter::ObjectValue *_currentObject;
|
||||
|
||||
public:
|
||||
EnumerateProperties(Interpreter::Context *context)
|
||||
EnumerateProperties(const Interpreter::Context *context)
|
||||
: _globalCompletion(false),
|
||||
_enumerateGeneratedSlots(false),
|
||||
_context(context),
|
||||
@@ -692,7 +692,7 @@ int CodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
|
||||
|
||||
const QList<AST::Node *> path = semanticInfo.astPath(editor->position());
|
||||
LookupContext::Ptr lookupContext = LookupContext::create(document, snapshot, path);
|
||||
Interpreter::Context *context = lookupContext->context();
|
||||
const Interpreter::Context *context = lookupContext->context();
|
||||
|
||||
// Search for the operator that triggered the completion.
|
||||
QChar completionOperator;
|
||||
|
||||
@@ -251,7 +251,7 @@ void HoverHandler::operateTooltip(TextEditor::ITextEditor *editor, const QPoint
|
||||
}
|
||||
|
||||
QString HoverHandler::prettyPrint(const QmlJS::Interpreter::Value *value,
|
||||
QmlJS::Interpreter::Context *context)
|
||||
const QmlJS::Interpreter::Context *context)
|
||||
{
|
||||
if (! value)
|
||||
return QString();
|
||||
|
||||
@@ -75,7 +75,7 @@ private:
|
||||
QmlJS::AST::Node *node);
|
||||
|
||||
QString prettyPrint(const QmlJS::Interpreter::Value *value,
|
||||
QmlJS::Interpreter::Context *context);
|
||||
const QmlJS::Interpreter::Context *context);
|
||||
|
||||
QmlJS::ModelManagerInterface *m_modelManager;
|
||||
QColor m_colorTip;
|
||||
|
||||
@@ -108,7 +108,7 @@ QmlOutlineItem &QmlOutlineItem::copyValues(const QmlOutlineItem &other)
|
||||
return *this;
|
||||
}
|
||||
|
||||
QString QmlOutlineItem::prettyPrint(const QmlJS::Interpreter::Value *value, QmlJS::Interpreter::Context *context) const
|
||||
QString QmlOutlineItem::prettyPrint(const QmlJS::Interpreter::Value *value, const QmlJS::Interpreter::Context *context) const
|
||||
{
|
||||
if (! value)
|
||||
return QString();
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
QmlOutlineItem ©Values(const QmlOutlineItem &other); // so that we can assign all values at onc
|
||||
|
||||
private:
|
||||
QString prettyPrint(const QmlJS::Interpreter::Value *value, QmlJS::Interpreter::Context *context) const;
|
||||
QString prettyPrint(const QmlJS::Interpreter::Value *value, const QmlJS::Interpreter::Context *context) const;
|
||||
|
||||
QmlOutlineModel *m_outlineModel;
|
||||
QmlJS::AST::Node *m_node;
|
||||
|
||||
Reference in New Issue
Block a user