MCPcopy Create free account
hub / github.com/KDE/kdevelop / startVisiting

Method startVisiting

plugins/qmljs/duchain/declarationbuilder.cpp:73–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73void DeclarationBuilder::startVisiting(QmlJS::AST::Node* node)
74{
75 DUContext* builtinQmlContext = nullptr;
76
77 if (QmlJS::isQmlFile(currentContext()) && !currentContext()->url().str().contains(QLatin1String("__builtin_qml.qml"))) {
78 builtinQmlContext = m_session->contextOfFile(
79 QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kdevqmljssupport/nodejsmodules/__builtin_qml.qml"))
80 );
81 }
82
83 {
84 DUChainWriteLocker lock;
85
86 // Remove all the imported parent contexts: imports may have been edited
87 // and there musn't be any leftover parent context
88 currentContext()->topContext()->clearImportedParentContexts();
89
90 // Initialize Node.js
91 QmlJS::NodeJS::instance().initialize(this);
92
93 // Built-in QML types (color, rect, etc)
94 if (builtinQmlContext) {
95 topContext()->addImportedParentContext(builtinQmlContext);
96 }
97 }
98
99 DeclarationBuilderBase::startVisiting(node);
100}
101
102/*
103 * Functions

Callers

nothing calls this directly

Calls 10

isQmlFileFunction · 0.85
topContextFunction · 0.85
strMethod · 0.80
contextOfFileMethod · 0.80
containsMethod · 0.45
urlMethod · 0.45
topContextMethod · 0.45
initializeMethod · 0.45

Tested by

no test coverage detected