3 Commits

Author SHA1 Message Date
Nikita Eshkeev
e807464037 [java][switch] IDEA-273874 "Can't resolve symbol" false-negative in switch with fall-through semantics
Resolve as many references as possible in order to keep the GoToSymbol action available but move invalid references in pattern matching for switch to the highlighter pass as the code review suggests

GitOrigin-RevId: 2339b7c9cd02b0d1e3c793c30a8a3338c28c9b73
2021-07-26 08:04:43 +00:00
Nikita Eshkeev
196a98de7d [java][switch completion] IDEA-273874 "Can't resolve symbol" false-negative in switch with fall-through semantics
When resolving PsiSwitchLabelStatement check if it participates in the fall-through semantics and if so, stop resolving unless the previous PsiSwitchLabelStatement is of the "case null" form.

GitOrigin-RevId: 74af92cde51a8d8ec3bae1c2cd3819a09a44cdf9
2021-07-19 20:32:24 +00:00
Nikita Eshkeev
e0970fca77 [java][resolve] IDEA-271676 Pattern matching for switch: fix resolve
Fix the resolve algorithm according to [JEP 406](https://openjdk.java.net/jeps/406). It includes:

- The correct resolution of variables in pattern matching guards in both if and switch
- Restricting the maximal scope of resolving by the PsiSwitchLabeledRuleStatement
- Various tests for resolving variable in pattern matching for switch

Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com>

GitOrigin-RevId: 1efb10f50a458a382a71ffeaef5a0f540b4a8893
2021-06-19 21:31:03 +00:00