Show in the completion box only the visible IDs.

This commit is contained in:
Roberto Raggi
2010-01-22 09:37:44 +01:00
parent 33bc7d7708
commit 68a8b6a663

View File

@@ -243,12 +243,18 @@ int QmlCodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
return -1;
}
const QFileInfo currentFileInfo(qmlDocument->fileName());
const QString currentFilePath = currentFileInfo.absolutePath();
const QIcon typeIcon = iconForColor(Qt::yellow);
foreach (QmlJS::Document::Ptr doc, snapshot) {
const QFileInfo fileInfo(doc->fileName());
if (fileInfo.suffix() != QLatin1String("qml"))
continue;
else if (fileInfo.absolutePath() != currentFilePath) // ### FIXME includ `imported' components
continue;
const QString typeName = fileInfo.baseName();
if (typeName.isEmpty())