Skip to content

Conversation

@Emptycz
Copy link
Contributor

@Emptycz Emptycz commented Dec 11, 2025

This is my very first open-source contribution, so I apologise for any mistakes with this PR or my approach to contributing!

This is still in draft (there is a lot of missing parts -- see the Issues todo-list below)

Overview:

This PR should add the generation of temporary files based on metadata. The goal is to have "jump to definition" (ctrl + click) feature not only for in-solution classes/methods (that's already implemented), but also for built-in methods in the framework or language. This adds that.

It is only a concept and a draft. Right now it works kind of correctly. When testing with ASP.Net framework (building APIs), I can jump into generated definition of built-in methods, such as .MapHub<T>(string route):
image

When CTRL + click on .MapHub, it generates a new temporary file and opens it in the editor. Unfortunately, the highlighter breaks right now, and it does not seem to work for built-in classes, such as Exceptions, or Task, etc. The result looks like this.
image

Also, I apologise for the foreign language; the compiler seems to be generating parts of the comments in the system language, I guess?

Issues Todo-list:

  • Breaking syntax highlighter
  • Move the "name of the folder" for temporary files and possibly its path to config/env
  • We are currently persisting the generated file on the drive, that's because I couldn't find a way to pass into the Editor just a buffer -- although this itself is not bad, it can work as a cache for running session -- that's not yet implemented
  • We must remove temp files on startup of the application, otherwise we will be filling the drive
  • Missing ReadOnly flag for SharpIdeFile, so the generated files cannot be modified (not really an issue, I guess, more like nice to have)

I agree to the terms of contributing as stated here

@MattParkerDev
Copy link
Owner

Thanks for looking into this! Do you know if IMetadataAsSourceService handles decompiling e.g. nuget packages, or only system/runtime/sdk dlls?

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

Successfully merging this pull request may close these issues.

2 participants