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 NotImplementedException ctor opens TypeNameParser.cs #63532

Closed
cremor opened this issue Aug 23, 2022 · 11 comments
Closed

Go to definition on NotImplementedException ctor opens TypeNameParser.cs #63532

cremor opened this issue Aug 23, 2022 · 11 comments
Labels
Area-IDE Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Milestone

Comments

@cremor
Copy link

cremor commented Aug 23, 2022

Version Used: Visual Studio 17.3.1

Steps to Reproduce:

  1. Create a new .NET 6 console application.
  2. Add the code throw new NotImplementedException();
  3. Use "Go to definition" (or "Go to implementation") on the NotImplementedException constructor call.

Expected Behavior:
The NotImplementedException class should be opened.

Actual Behavior:
The file TypeNameParser.cs, which contains the classes SafeTypeNameParserHandle and TypeNameParser, is opened.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 23, 2022
@cremor
Copy link
Author

cremor commented Aug 23, 2022

Tagging @davidwengier because he fixed the last Go to definition bug that I found 😃

@davidwengier
Copy link
Contributor

Did the source come from SourceLink? (it should say in the Visual Studio tab).
What symbol servers do you have turned on?
Can you paste in the output from the "Navigate To External Sources" category in the Output Window.

@cremor
Copy link
Author

cremor commented Aug 23, 2022

Yes, source is from source link:
grafik

No symbol servers turned on.
grafik

Output from output window:

Navigating to symbol 'System.NotImplementedException.NotImplementedException()' from 'System.Runtime'.
Symbol found in assembly path 'C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.8\ref\net6.0\System.Runtime.dll'
Symbol found in assembly path 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.8\System.Runtime.dll'
Symbol found in assembly path 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.8\System.Private.CoreLib.dll'
Found PDB on symbol server.
'/_/src/coreclr/System.Private.CoreLib/src/System/TypeNameParser.cs' found via SourceLink.

@davidwengier
Copy link
Contributor

Thanks, I can see what is going on. It's resolving the symbols incorrectly, finding the metadata from the reference assembly, but using that on the implementation assembly.

@davidwengier
Copy link
Contributor

Oh, I forgot. I already fixed this :)

Fixed by #62406

@davidwengier davidwengier added this to the 17.4 P1 milestone Aug 23, 2022
@davidwengier davidwengier added Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 23, 2022
@cremor
Copy link
Author

cremor commented Aug 23, 2022

Thanks. Is there a workaround for this? Or is it another thing where we have to wait until 17.4 to get a working go to defintion back, like #63424?
Sorry for sounding negative, but I really regret updating to 17.3 already 😞

@davidwengier
Copy link
Contributor

I'm afraid not. 17.4 Preview 1 is out, and can be installed side-by-side with 17.3, but at this point of release unless a bug causes a hard crash for a lot of users, or is a security fix of some kind, its not going to meet the bar for servicing.

@cremor
Copy link
Author

cremor commented Aug 23, 2022

OT: Is 17.3 special somehow in that only such important bugs are fixed? Because in previous versions there often have been small fixes. E.g. just two weeks ago 17.2.7 was released and it even contained a fix for a visual imperfection according to the release notes.

@davidwengier
Copy link
Contributor

No, nothing special about 17.3. I don't know the specifics of that issue, but potentially it was impacting every VS user who uses git, which would be a lot more users than people who try to go-to-def on .NET types.

@cremor
Copy link
Author

cremor commented Aug 23, 2022

I found another case. Is this fixed too?

  1. Go to definition on HashCode.Combine<T1, T2>(T1, T2).
  2. Opens source link file RuntimeType.CoreCLR.cs

Output window:

Navigating to symbol 'System.HashCode.Combine<T1, T2>(T1, T2)' from 'System.Runtime'.
Symbol found in assembly path 'C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.8\ref\net6.0\System.Runtime.dll'
Symbol found in assembly path 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.8\System.Runtime.dll'
Symbol found in assembly path 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.8\System.Private.CoreLib.dll'
Found PDB on symbol server.
'/_/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs' found via SourceLink.

@davidwengier
Copy link
Contributor

Yeah, the bug was around following typeforwards, which you can identify by 3 or more "Found symbol" lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Projects
None yet
Development

No branches or pull requests

2 participants