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 implementation command, should view open source code #24559

Closed
ghost opened this issue Jan 31, 2018 · 19 comments
Closed

Go to implementation command, should view open source code #24559

ghost opened this issue Jan 31, 2018 · 19 comments
Labels
Area-IDE Feature Request Resolution-Duplicate The described behavior is tracked in another issue
Milestone

Comments

@ghost
Copy link

ghost commented Jan 31, 2018

Version Used:
VS Community 15.5.1

Steps to Reproduce:
VS code editor has a "Go to implementation" context menu command. I suggest you allow this command to view the open source code of the requested Item. I need to look at the source code frequently, when documentations are poor to understand what is going on. The viewed source code should appear in VS as a code page, and contain a link to the gethub issues page to report any problems or suggestions.

Expected Behavior:
View the open source code.

Actual Behavior:
This sympole has no implementaions

Edit:
I'm talking about all. Net open source here in github. I was dealing with the Vector class. Documentsion is poor, and trying to open the html page for vector.cs here in github was a nightmare because it's huge. There is no link to download the source code of one class, or even a namespace. I only can download the CoreFX projec! So, I thought what if Vs.net code editor can browse to it directly, but it can't. This samll feather can integrate open source projects with Vs.net, encouraging developers to participate.

Github can provide a search request url that accepts the full name of a class and returns the link to opebn source file containing it. This way Vs.net code editor can download the requested file and view it, eather in design mode, or in debugging mode. It will be nice if you give us the ability to choose to trace the execution of this source code or just step over it. Also, the code page that results from the "Go to definition" command can have a "goto implementation" command to vieew the source code from there.

@CyrusNajmabadi
Copy link
Member

I suggest you allow this command to view the open source code of the requested Item

This is how the feature works :)

This sympole has no implementaions

That's because we couldn't find any implementations. If we can't find any implementations there's no "source code of the requested item" we could "open" for you.

@jmarolf
Copy link
Contributor

jmarolf commented Feb 2, 2018

@MohammadHamdyGhanem I assume you want us to decompile the source if there is none to navigate to?

@jcouv
Copy link
Member

jcouv commented Feb 2, 2018

I suspect the suggestion is that GoToImplementation should download the open-source code (from github or elsewhere on the web, determined somehow) and open that.
For example, if you use NewtonSoft's Json.NET as a nuget package, actual source (rather than decompiled source) should be opened when you invoke GoToImplementation.

I wonder if this is something that package/library authors can already achieve, either with source link or embedded source. It's possible that source link works when debugging, but not when simply editing.

@ghost
Copy link
Author

ghost commented Feb 2, 2018

Sorry if I was not clear. @jcouv made it crystal clear. I'm talking about all. Net open source here in github. I was dealing with the Vector class. Documentsion is poor, and trying to open the html page for vector.cs here in github was a nightmare because it's huge. There is no link to download the source code of one class, or even a namespace. I only can download the CoreFX projec! So, I thought what if Vs.net code editor can browse to it directly, but it can't. This samll feather can integrate open source projects with Vs.net, encouraging developers to participate.

@ghost
Copy link
Author

ghost commented Feb 2, 2018

I wonder if this is something that package/library authors can already achieve, either with source link or embedded source. It's possible that source link works when debugging, but not when simply editing.

Github can provide a search request url that accepts the full name of a class and returns the link to opebn source file containing it. This way Vs.net code editor can download the requested file and view it, eather in design mode, or in debugging mode. It will be nice if you give us the ability to choose to trace the execution of this source code or just step over it. Also, the code page that results from the "Go to definition" command can have a "goto implementation" command to vieew the source code from there.

@jinujoseph jinujoseph added this to the Unknown milestone Apr 20, 2018
@ghost
Copy link
Author

ghost commented Feb 8, 2019

@CyrusNajmabadi @jmarolf @jcouv @jinujoseph
Now that MS owns Github, it is easy to implement this command, and make it easier for us to jumb to the source code of any built-in class. Please do it.

@CyrusNajmabadi
Copy link
Member

@MohammadHamdyGhanem I don't see what difference it makes if MS owns Github.

@ufcpp
Copy link
Contributor

ufcpp commented Feb 8, 2019

SourceLink?

@jinujoseph
Copy link
Contributor

cc @tmat

@jcouv
Copy link
Member

jcouv commented Feb 8, 2019

Yes, this should work with SourceLink now. This should be done by individual package owners.

@ghost
Copy link
Author

ghost commented Feb 8, 2019

@CyrusNajmabadi
You didn't get my idea till now. Suppose I'm using System.Math.Round() and want to look to its source code. Instead of searching githup, I want to right-click the Round Method in my code, and click Go to Implementation to open the source code dirctly in a new tab in Vs.net, have all the editor support and tool tips, even set break points! When I first asked for it, maybe it was difficult to get support from githup, but now MS can do any necessary changes to github it self to make it easy to send a reguest with just a full qualified method name to navigate directly to its source without making any change in the. Net source code itself.

@sharwell
Copy link
Member

sharwell commented Feb 8, 2019

Duplicate of #24349

@sharwell sharwell marked this as a duplicate of #24349 Feb 8, 2019
@sharwell sharwell closed this as completed Feb 8, 2019
@sharwell sharwell added the Resolution-Duplicate The described behavior is tracked in another issue label Feb 8, 2019
@ghost
Copy link
Author

ghost commented Feb 8, 2019

@sharwell
This is different. #24349 wants to decompile the assebly, and I want to get the code from Github source code.

@sharwell
Copy link
Member

sharwell commented Feb 8, 2019

@MohammadHamdyGhanem Prior to attempting to decompile, that issue says we should attempt to locate and use the original source code when possible. This includes but isn't limited to sources linked to GitHub.

@jmarolf
Copy link
Contributor

jmarolf commented Feb 9, 2019

@MohammadHamdyGhanem see here and here. I believe what you want is for all the .NET assemblies that Microsoft ships to support SourceLink. @tmat I believe SourceLink is used automatically now for all .NET Core builds correct?

@tmat
Copy link
Member

tmat commented Feb 9, 2019

Yes.

@tmat
Copy link
Member

tmat commented Feb 9, 2019

@jmarolf BTW, corrected Source Link link in your comment to: http://github.com/dotnet/sourcelink

@sharwell
Copy link
Member

sharwell commented Feb 9, 2019

@jmarolf Note that SourceLink currently only supports debugging scenarios. It doesn't help the normal editing experience scenarios suggested in this issue at all.

@tmat
Copy link
Member

tmat commented Feb 9, 2019

@sharwell Currently. There is no reason it couldn't be used outside of debugging session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Feature Request Resolution-Duplicate The described behavior is tracked in another issue
Projects
None yet
Development

No branches or pull requests

7 participants