Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go-to-definition on return statements should jump to the containing function declaration #51222

Closed
DanielRosenwasser opened this issue Oct 19, 2022 · 4 comments · Fixed by #51227
Labels
Domain: Symbol Navigation Relates to go-to-definition, find-all-references, highlighting/occurrences. Experience Enhancement Noncontroversial enhancements Good First Issue Well scoped, documented and has the green light Help Wanted You can do this

Comments

@DanielRosenwasser
Copy link
Member

function foo() {
    return /*END*/() => {
        /*START*/return 10;
    }
}

Go to definition on START should jump you up to the containing function.

It should be resilient to questionable placements of return and do nothing, as in the following cases.

/*a*/return;


function foo() {
    class Foo {
       static { /*b*/return; }
    }
}
@DanielRosenwasser
Copy link
Member Author

Thank you @a-tarasyuk!

@sheetalkamat
Copy link
Member

@DanielRosenwasser Suggestion, we probably can get find all references to show all return statements and signature?

@DanielRosenwasser
Copy link
Member Author

Agreed, I was thinking this last night too!

@DanielRosenwasser
Copy link
Member Author

@sheetalkamat, I filed #51232 for that. I think the big question is whether it should just return whatever document highlights returns, or it should return a more-curated list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: Symbol Navigation Relates to go-to-definition, find-all-references, highlighting/occurrences. Experience Enhancement Noncontroversial enhancements Good First Issue Well scoped, documented and has the green light Help Wanted You can do this
Projects
None yet
2 participants