QML/JS aliases vs. imports
steckdenis at yahoo.fr
Fri Jul 11 14:11:57 UTC 2014
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 :
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?
More information about the KDevelop-devel