You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Go-to-definition on await/yield should probably jump to the containing respective async function/generator #51223
We should probably do nothing in cases like top-level await, or where await does not have a direct corresponding async function, and yield does not have a direct corresponding generator.
I would expect GTD on await to jump to the async keyword of the containing function, in line with how e.g. VS C# intellisense highlights the async keyword (and incidentally, all the other awaits in the same function) when you place the cursor on an await.
I feel like the distance is not that big that it matters whether we pick END1 or END2. I could go both ways.
Thinking about it some more, I wonder if it makes sense to always make the go-to-definition succeed, even if the containing function isn't async or a generator. If you're in the error case, it can be helpful to jump to whichever function contains the keyword.
Activity
fatcerberus commentedon Oct 19, 2022
I would expect GTD on
awaitto jump to theasynckeyword of the containing function, in line with how e.g. VS C# intellisense highlights theasynckeyword (and incidentally, all the otherawaits in the same function) when you place the cursor on anawait.DanielRosenwasser commentedon Oct 19, 2022
I guess maybe there's a catch with
I feel like the distance is not that big that it matters whether we pick
END1orEND2. I could go both ways.Thinking about it some more, I wonder if it makes sense to always make the go-to-definition succeed, even if the containing function isn't async or a generator. If you're in the error case, it can be helpful to jump to whichever function contains the keyword.
DanielRosenwasser commentedon Oct 19, 2022
Also, another fun test case based on the "should not fail" strategy".