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

Endpoint for use with GoToTypeDefinition VS Code command #2297

Open
jtschuster opened this issue Dec 4, 2021 · 0 comments
Open

Endpoint for use with GoToTypeDefinition VS Code command #2297

jtschuster opened this issue Dec 4, 2021 · 0 comments

Comments

@jtschuster
Copy link
Contributor

VS Code has a command editor.action.goToTypeDefinition that is implemented for a number of languages, but not for C#. At the moment I don't see a way to use the existing endpoints to create this functionality. A new endpoint to go to the definition of the type / class of a variable would be helpful in C# workflow, especially when using implicitly typed variables that don't have the name of the type anywhere in the file.

Example:
file1.cs:

class C {
    C NamedConstructor() { return new C(); }
}

file2.cs:

class D {
    void method() 
    {
        var variableName = NamedConstructor();
    }
}

GoToTypeDefinition at the position of variableName would return the definition of the class C in file1.cs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant