Commit 3bdaff44 authored by Denis Steckelmacher's avatar Denis Steckelmacher

Restrict the automatic file import to .js and .qml files

If a QML is in the same directory as .cpp files and a CMakeLists.txt, it doesn't
make sense that it sees all the top-level declarations of those files.
parent 08df2d7d
......@@ -76,7 +76,7 @@ void DeclarationBuilder::startVisiting(QmlJS::AST::Node* node)
if (file.exists() && !file.absolutePath().contains(QLatin1String("kdevqmljssupport"))) {
// Explore all the files in the same directory as the current file, parse
// them and import their context.
QDirIterator dir(file.absolutePath(), QDir::Files);
QDirIterator dir(file.absolutePath(), QStringList() << "*.qml" << "*.js", QDir::Files);
DUChainWriteLocker lock;
while (dir.hasNext() && dir.next() != file.absoluteFilePath()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment