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 doesn't show me the actuall implementation (VSCode) #5969

Closed
moamlrh opened this issue Jul 29, 2023 · 14 comments · Fixed by dotnet/roslyn#69501
Closed

Go To Definition doesn't show me the actuall implementation (VSCode) #5969

moamlrh opened this issue Jul 29, 2023 · 14 comments · Fixed by dotnet/roslyn#69501
Assignees
Milestone

Comments

@moamlrh
Copy link

moamlrh commented Jul 29, 2023

Type: Bug

When I press F12 or use the Go To Definition option, it only shows me the definition without any implementation. Similarly, when I click on Go To Implementation, it doesn't work either, it shows me No Implementation Found For "BlaBla"

Btw I was using C# Release version it was work fine tho, but when I upgraded to the pre-release version I got this problem

  • It works fine on my own code, but when I'm trying to use it on an external library it will show me just the definition without any implementation.

Sample :

public class User : ClassFromExternalLibrary
{
   // code here
}

When I press "F12/go-to-def" on ClassFromExternalLibrary will show me the definition with this on top of the file:

#region Assembly ExternalLibarayNameHere, Version=2.0, Culture=neutral, PublicKeyToken=null
// /home/user/.nuget/packages/ExternalLibarayNameHere/2.0/lib/net6.0/ExternalLibarayNameHere.dll
#endregion

I'm using :

  • VSCode Information :
    Version: 1.80.2
    Chromium: 108.0.5359.215
    Node.js: 16.17.1
    V8: 10.8.168.25-electron.0
    OS: Linux x64 6.4.4-200.fc38.x86_64

  • C# extension (v2.0.312 "Pre-Release version")

  • C# Dev Kit extension (v0.3.18 Pre-Release version)

  • Dotnet version (8.0.100-preview.6.23330.14)

  • Everything is work fine (autocomplete, intellicode, go-to-def(on my own code))

Extension version: 2.0.312
VS Code version: Code 1.80.2 (2ccd690cbff1569e4a83d7c43d45101f817401dc, 2023-07-27T20:41:52.615Z)
OS version: Linux x64 6.4.4-200.fc38.x86_64
Modes:

A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscoreces:30445986
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
2e4cg342:30602488
f6dab269:30613381
a9j8j154:30646983
showlangstatbar:30737416
vsctsb:30748421
03d35959:30757346
pythonfmttext:30731395
pythoncmv:30756943
fixshowwlkth:30771522
showindicator:30785052
pythongtdpath:30769146
i26e3531:30792625
gsofa:30797621
pythonnosmt12:30797651
pythonnoceb:30797650
e537b577:30795824
dsvsc013:30795093
dsvsc014:30797589

@moamlrh
Copy link
Author

moamlrh commented Aug 14, 2023

any updates ? @dibarbet

@dibarbet
Copy link
Member

Will do my best to get to it this week. @moamlrh to make sure I understand - you want to see the decompiled source of ClassFromExternalLibrary from the nuget package correct?

@moamlrh
Copy link
Author

moamlrh commented Aug 14, 2023

Exactly, I was trying to to see the implementation/code of any external function/class like a function from Nuget package

Btw I solved the issue by disabled C# DevKit extension, I'm not sure if it was an issue with C# DevKit

But I do need to use this extension C# DevKit

@CyrusNajmabadi
Copy link
Member

Dupe of: #5969

@CyrusNajmabadi CyrusNajmabadi closed this as not planned Won't fix, can't repro, duplicate, stale Aug 21, 2023
@dibarbet
Copy link
Member

@CyrusNajmabadi the dupe links to this issue. Meant to link another one?

@dibarbet
Copy link
Member

This should be in this weeks release (Wednesday).

@JasonLeeForOnly
Copy link

Same problem here,Was the lateset version of C# DevKit settled?

@JasonLeeForOnly
Copy link

Same problem here,Was the lateset version of C# DevKit settled?

image
NEED HELP
Unable to decompile and view the classes of interfaces in the assembly.

Name: C# Dev Kit
ID: ms-dotnettools.csdevkit
Version: 0.5.2

@christophwille
Copy link

It does work, but you need what we described here https://twitter.com/ilspy/status/1697115935629267198

Enable dotnet.navigation.navigateToDecompiledSource
image

@moamlrh
Copy link
Author

moamlrh commented Sep 7, 2023

NEED HELP Unable to decompile and view the classes of interfaces in the assembly.

Name: C# Dev Kit ID: ms-dotnettools.csdevkit Version: 0.5.2

It works for me on this version v2.0.436

image
image

@dibarbet
Copy link
Member

dibarbet commented Sep 7, 2023

Same problem here,Was the lateset version of C# DevKit settled?

image NEED HELP Unable to decompile and view the classes of interfaces in the assembly.

Name: C# Dev Kit ID: ms-dotnettools.csdevkit Version: 0.5.2

In your screenshot you are in the decompiled source - at the top it says 'Decompiled with ICSharpCode.Decompiler'.

However there is currently an issue where you cannot go to definition from inside a decompiled source file. That is tracked by #5787

@JasonLeeForOnly
Copy link

Same problem here,Was the lateset version of C# DevKit settled?

image NEED HELP Unable to decompile and view the classes of interfaces in the assembly.

Name: C# Dev Kit ID: ms-dotnettools.csdevkit Version: 0.5.2

In your screenshot you are in the decompiled source - at the top it says 'Decompiled with ICSharpCode.Decompiler'.

However there is currently an issue where you cannot go to definition from inside a decompiled source file. That is tracked by #6021

okay I got it,really appreciate your help

@nhoefer2
Copy link

What if I wanted to view the source of packages using the package symbols?
I find this very odd because when I ctrl+click something, it will take me to the decompiled code but when I step into the code from the debugger (which uses the symbols), it gives me very different code. It almost seems like a bug because when I step into the code with the debugger, it shows me the source from the symbols but its not actually running that code. Instead, it behaves like its running the compiled binary. I'm seeing weird things when debugging like a function returning when stepping over a line that doesn't even have a return (not from an exception thrown). Has anyone else ever encountered this?

@dibarbet
Copy link
Member

I find this very odd because when I ctrl+click something, it will take me to the decompiled code but when I step into the code from the debugger (which uses the symbols), it gives me very different code

It is possible you're seeing the sourcelink source in the debugger - which is the real, not decompiled source. We are tracking enabling source link for goto definition here - #6784

Instead, it behaves like its running the compiled binary. I'm seeing weird things when debugging like a function returning when stepping over a line that doesn't even have a return (not from an exception thrown). Has anyone else ever encountered this?

If you're debugging a binary built with optimizations enabled (e.g. release mode) this can happen with either decompiled source or source link source.

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

Successfully merging a pull request may close this issue.

7 participants