QML/JS aliases vs. imports
Denis Steckelmacher
steckdenis at yahoo.fr
Fri Jul 11 14:11:57 UTC 2014
Hi,
I've removed all the alias declarations that were used by the QML/JS
plugin, and I replaced them with imported parent contexts (where
applicable) and the use of the persistent symbol table.
I think that Reviewboard does not allow review requests for commits
living in scratch repositories, so here is a commit on which I would
like some advice :
http://quickgit.kde.org/?p=scratch%2Fdsteckelmacher%2Fkdev-qmljs.git&a=commitdiff&h=c5e1efd0c9120c27a8e5ede5879e12b4da307bb4
.
This commit uses PersistentSymbolTable to find the declaration of global
identifiers. Everything works well, but I'm not very happy with how the
"two files are in the same directory" condition works. I'm obliged to
call IndexedString::str, then QDir::fromNativeSeparator and finally
QString::section in order to finally get the directory path of the file.
Is there a quicker way of doing this?
Regarding the speed of my solution, the testsuite of the plugin (that
parses tens of different files, plus several QML modules) ran in 5.36
seconds on my computer before my commit. With the commit applied, the
testsuite runs in 5.40 seconds, so the impact of the commit seems to be
negligible, and PersistentSymbolTable seems to be very fast. Can someone
confirm that what I've done is correct?
Denis
More information about the KDevelop-devel
mailing list