forked from qt-creator/qt-creator
Show in the completion box only the visible IDs.
This commit is contained in:
@@ -243,12 +243,18 @@ int QmlCodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QFileInfo currentFileInfo(qmlDocument->fileName());
|
||||||
|
const QString currentFilePath = currentFileInfo.absolutePath();
|
||||||
|
|
||||||
const QIcon typeIcon = iconForColor(Qt::yellow);
|
const QIcon typeIcon = iconForColor(Qt::yellow);
|
||||||
|
|
||||||
foreach (QmlJS::Document::Ptr doc, snapshot) {
|
foreach (QmlJS::Document::Ptr doc, snapshot) {
|
||||||
const QFileInfo fileInfo(doc->fileName());
|
const QFileInfo fileInfo(doc->fileName());
|
||||||
|
|
||||||
if (fileInfo.suffix() != QLatin1String("qml"))
|
if (fileInfo.suffix() != QLatin1String("qml"))
|
||||||
continue;
|
continue;
|
||||||
|
else if (fileInfo.absolutePath() != currentFilePath) // ### FIXME includ `imported' components
|
||||||
|
continue;
|
||||||
|
|
||||||
const QString typeName = fileInfo.baseName();
|
const QString typeName = fileInfo.baseName();
|
||||||
if (typeName.isEmpty())
|
if (typeName.isEmpty())
|
||||||
|
|||||||
Reference in New Issue
Block a user