Open DanielRosenwasser opened 2 years ago
Both options have a reason to be. Maybe take it out in the config? But then this option should also be applicable for the return
for uniformity.
If we still go to the definition on return
, then it is more logical to do the same in these cases.
Additional test cases:
/*END*/label: switch (null) {
case null: {
test: switch (null) {
case null: /*START*/break label;
}
}
}
/*END*/label: while (true) {
while (true) {
if (Math.random()) /*START*/continue label;
}
}
label: switch (null) {
case null: [|/*START*/break|] test;
}
okay, my pr is ready. Waiting for closure #51236
However, I could also see us jumping to wherever the
break
orcontinue
itself would jump. That's a bit at odds with the original intent of go-to-definition onreturn
since the point of that was to figure out "who owns the currentreturn
statement?"
Well, personally I would prefer if go-to-definition on return
would go to the call. 😉
Similar to #51222 and #51223.
Given how go-to-definition on
return
,await
, andyield
might work, it's tempting to jump up to the top of the corresponding statement.However, I could also see us jumping to wherever the
break
orcontinue
itself would jump. That's a bit at odds with the original intent of go-to-definition onreturn
since the point of that was to figure out "who owns the currentreturn
statement?"If someone wants to send a PR and discuss more in that PR, they're welcome to.