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

Method run

plugins/qmljs/qmljsparsejob.cpp:88–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88void QmlJsParseJob::run(ThreadWeaver::JobPointer pointer, ThreadWeaver::Thread* thread)
89{
90 Q_UNUSED(pointer)
91 Q_UNUSED(thread)
92
93 UrlParseLock urlLock(document());
94 if (abortRequested() || !isUpdateRequired(ParseSession::languageString())) {
95 return;
96 }
97
98 // Don't parse this file if one of its dependencies is not up to date
99 const auto& dependencies = QmlJS::Cache::instance().dependencies(document());
100 for (auto& dependency : dependencies) {
101 if (!QmlJS::Cache::instance().isUpToDate(dependency)) {
102 QmlJS::Cache::instance().setUpToDate(document(), false);
103 return;
104 }
105 }
106
107 qCDebug(KDEV_QMLJS) << "parsing" << document().str();
108
109 ProblemPointer p = readContents();
110 if (p) {
111 //TODO: associate problem with topducontext
112 return;
113 }
114
115 ParseSession session(document(), QString::fromUtf8(contents().contents), priority());
116
117 if (abortRequested()) {
118 return;
119 }
120
121 ReferencedTopDUContext context;
122 {
123 DUChainReadLocker lock;
124 context = DUChainUtils::standardContextForUrl(document().toUrl());
125 }
126 if (context) {
127 translateDUChainToRevision(context);
128 context->setRange(RangeInRevision(0, 0, INT_MAX, INT_MAX));
129 }
130
131 if (session.ast()) {
132 QReadLocker parseLock(languageSupport()->parseLock());
133
134 if (abortRequested()) {
135 abortJob();
136 return;
137 }
138
139 DeclarationBuilder builder(&session);
140 context = builder.build(document(), session.ast(), context);
141
142 if (abortRequested()) {
143 abortJob();
144 return;
145 }

Callers

nothing calls this directly

Calls 15

isUpToDateMethod · 0.80
setUpToDateMethod · 0.80
strMethod · 0.80
setRangeMethod · 0.80
parseLockMethod · 0.80
buildUsesMethod · 0.80
addDocumentChainMethod · 0.80
reparseImportersMethod · 0.80

Tested by

no test coverage detected