<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/118238/">https://git.reviewboard.kde.org/r/118238/</a>
</td>
</tr>
</table>
<br />
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Ok, got it. The problem is that you queue a file in the parsejob, but the test assumes that once the first pass finished the parsing is done and runs its test on the result and then starts cleanup. Thus it does the cleanup while the other thread is still parsing. A simple fix is to add
while ( ICore::self()->languageController()->backgroundParser()->queuedCount() != 0 ) {
QTest::qWait(10);
}
in testFiles after the waitForUpdate call.
Milian, what do you think about this issue? Is that an acceptable solution?</pre>
<br />
<p>- Sven Brauch</p>
<br />
<p>On May 22nd, 2014, 4:44 p.m. UTC, Denis Steckelmacher wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for KDevelop.</div>
<div>By Denis Steckelmacher.</div>
<p style="color: grey;"><i>Updated May 22, 2014, 4:44 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
kdev-qmljs
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This patch adds a method that returns the top-level DUContext associated with a QML plugin. It uses KStandardDirs to get the plugin.qmltypes file associated with the module (these files are installed by the plugin in KDE_DATA/kdevqmljssupport/qmlplugins/Module.qml), and then schedules a parse job for the file. If the file has already been parsed, then its top level context is returned. This method will be used to implement import statements. The module files and the complete support for import statements can be found in the "import_statements" of kde:scratch/dsteckelmacher.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This patch cannot be tested as the method is not yet called, but the support for import statements is already implemented in my kde:scratch/dsteckelmacher repository. Import statements work right in KDevelop, but the unit tests segfault when they have to parse a file containing an import. The crash always happens in an openDeclaration() or currentDeclaration() call, and if I comment the faulting call, another one will crash. The crash does not happen anymore if I remove the calls to "bgparser->addDocument" added in this patch, and does not happen in a complete KDevelop instance.
I'm therefore wondering how the background parser can interact with openDeclaration(). I've checked and a DUChainReadLock or a DUChainWriteLock is always held when openDeclaration() is called, but maybe there are other locks that may be needed. I turn to more advanced KDevelop developers on this matter.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>CMakeLists.txt <span style="color: grey">(9e90f99)</span></li>
<li>duchain/declarationbuilder.h <span style="color: grey">(265d0ce)</span></li>
<li>duchain/declarationbuilder.cpp <span style="color: grey">(10701bd)</span></li>
<li>duchain/parsesession.h <span style="color: grey">(0facef4)</span></li>
<li>duchain/parsesession.cpp <span style="color: grey">(998e5b0)</span></li>
<li>qmlplugins/Builtins1.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/Builtins2.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/CMakeLists.txt <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/Qt.labs.folderlistmodel.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/Qt.labs.gestures.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/Qt.labs.particles.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/Qt.labs.settings.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/Qt.labs.shaders.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/QtAudioEngine.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/QtBluetooth.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/QtMultimedia.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/QtNfc.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/QtPositioning.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/QtQuick.Controls.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/QtQuick.Dialogs.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/QtQuick.Layouts.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/QtQuick.LocalStorage.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/QtQuick.Particles.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/QtQuick.PrivateWidgets.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/QtQuick.Window.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/QtQuick.XmlListModel.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/QtQuick.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/QtSensors.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/QtTest.qml <span style="color: grey">(PRE-CREATION)</span></li>
<li>qmlplugins/importplugins.sh <span style="color: grey">(PRE-CREATION)</span></li>
<li>tests/files/test.qml <span style="color: grey">(605716d)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/118238/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>