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 not working in stand alone cs file #1264

Closed
DesHorsley opened this issue Feb 27, 2017 · 2 comments
Closed

Go to Definition not working in stand alone cs file #1264

DesHorsley opened this issue Feb 27, 2017 · 2 comments

Comments

@DesHorsley
Copy link

Environment data

dotnet --info output:
.NET Command Line Tools (1.0.0-preview2-003131)

Product Information:
Version: 1.0.0-preview2-003131
Commit SHA-1 hash: 635cf40e58

Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64

VS Code version:
C# Extension version: 1.91

I have a stand alone .cs file with a class and some methods in it. Go to Definition doesn't seem to be working. I saw somewhere some comments about the feature requiring a project.json file, is that correct?

At first I thought this may have had something to do with the file not having been saved, but even after saving it, it still doesn't seem to work.

For some test data paste the below into a new window:

public class MyClass
{
    private void GetRecent()
    {
        // Get the thing
    }

    private void Load()
    {
        
        GetRecent();
    }
}

Click on the GetRecent call in the Load Method and then hit F12

@DustinCampbell
Copy link
Member

In general, you'll need to have a project to get features like Go to Definition and IntelliSense working. It doesn't have to be a project.json file. A .csproj will work fine.

Making features work better in standalone files is on our backlog. We're tracking the work with #47.

@DesHorsley
Copy link
Author

Thanks @DustinCampbell I can work with that. I've transitioned from Sublime for my everyday editor to VSCode, and I'm enjoying it so far, this was one of my few, small, gripes. Cheers.

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

No branches or pull requests

2 participants