Skip to content

Commit 6771ac0

Browse files
Sergei Tachenovintellij-monorepo-bot
Sergei Tachenov
authored andcommitted
[platform] RIDER-93719 Select in Project View: fall back to virtualFile if element is null
This should fix the regression and shouldn't break anything because if the element is null it may either mean that it wasn't specified intentionally, and we should select the file, or that it may have been invalidated by a PSI reparse, in which case it makes perfect sense to select the containing file instead. GitOrigin-RevId: 47567eddfbb4b51d71e54a4e720736b35f3b6518
1 parent a4c4725 commit 6771ac0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

platform/lang-impl/src/com/intellij/ide/projectView/impl/SelectInProjectViewImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ internal class SelectInProjectViewImpl(
134134
val virtualFile: VirtualFile?,
135135
)
136136
val context = readAction {
137-
val elementToSelect = elementSupplier.get() ?: return@readAction null
137+
val elementToSelect = elementSupplier.get() ?: virtualFile ?: return@readAction null
138138
SelectionContext(
139139
visibleAndSelectedUserObject != null && visibleAndSelectedUserObject.canRepresent(elementToSelect),
140140
virtualFile ?: (elementToSelect as? PsiElement)?.virtualFile

0 commit comments

Comments
 (0)