FIR IDE: fix duplicating diagnostics collection
This commit is contained in:
+2
-8
@@ -54,16 +54,10 @@ internal class FileStructure(
|
||||
fun getAllDiagnosticsForFile(): Collection<Diagnostic> {
|
||||
val containersForStructureElement = buildList {
|
||||
add(ktFile)
|
||||
ktFile.forEachDescendantOfType<KtDeclaration>(
|
||||
canGoInside = { psi -> psi !is KtFunction && psi !is KtValVarKeywordOwner }
|
||||
) { declaration ->
|
||||
if (FileStructureUtil.isStructureElementContainer(declaration)) {
|
||||
add(declaration)
|
||||
}
|
||||
}
|
||||
addAll(ktFile.declarations)
|
||||
}
|
||||
val structureElements = containersForStructureElement.map(::getStructureElementFor)
|
||||
return buildList {
|
||||
return buildSet {
|
||||
structureElements.forEach { it.diagnostics.forEach { diagnostics -> addAll(diagnostics) } }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user