[LL] find fir by psi: allow fallthrough to traverse tree for invalid code
In case of broken code e.g., duplicated classes provider would return first class, though we definitely need some code insight in this case at least to add navigation fixes, etc. Similar to this, a file copy is created during completion, where additional elements might appear and we need to search for them. Added test cases for duplicated classes.
This commit is contained in:
+6
@@ -0,0 +1,6 @@
|
||||
class SomeClass {
|
||||
val prop = "abc"
|
||||
}
|
||||
class SomeClass {
|
||||
<expr>fun foo() {}</expr>
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
KT element: KtNamedFunction
|
||||
FIR element: FirSimpleFunctionImpl
|
||||
FIR source kind: KtRealSourceElementKind
|
||||
|
||||
FIR element rendered:
|
||||
public final [ResolvedTo(BODY_RESOLVE)] fun foo(): R|kotlin/Unit| {
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
class SomeClass {
|
||||
val prop = "abc"
|
||||
}
|
||||
class SomeClass {
|
||||
fun foo(<expr>p: Int</expr>) {}
|
||||
}
|
||||
analysis/low-level-api-fir/testdata/getOrBuildFir/invalidCode/duplicatedClassesFunctionParameter.txt
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
KT element: KtParameter
|
||||
FIR element: FirValueParameterImpl
|
||||
FIR source kind: KtRealSourceElementKind
|
||||
|
||||
FIR element rendered:
|
||||
[ResolvedTo(BODY_RESOLVE)] p: R|kotlin/Int|
|
||||
Reference in New Issue
Block a user