DotRush icon indicating copy to clipboard operation
DotRush copied to clipboard

[Feature Request] Go To Definition should navigate to actual source code for symbols from an installed Unity Package

Open hackerzhuli opened this issue 6 months ago • 2 comments

Description

I am using Dot Rush for a few days and I have found something that can improve Unity development experience if implemented.

When I use context menu item Go To Definition(in Trae with Dot Rush) on a method from an installed package, it navigates to the method in a decompiled source while the source code for it lives right inside of PackageCache.

Image

It will be much better if we can navigate to the actual source code, where we can see comments, which helps a lot. This can be very useful when the official documentation for the package is lacking or too simple and we want to read the source code.

Note: for a method from an embedded package(that is, in Packages folder), it navigates to source code, which is correct.

Additional Note: Dot Rush seems to have inconsistent behavior, because some of the time, it points to the source file in PackageCache (when mouse is on a symbol, which can be observed by another extension) while most of the time, it points to a decompiled file. But I cannot reproduce this(it is rare that it points to the actual source file).

Other IDE or VS Code Extension

C# Dev Kit in VS Code behaves in the same way as Dot Rush.

However, in Rider, when I Go To Definition(it's actually called Go To Declaration or Usages in Rider) on a method from an installed package, it navigates to the actual source code living inside of PackageCache. Here is a screenshot:

Image

Reproduction

Unity Version: 6000.0.51f1 OS: Windows 11 Code Editor: Trae (but should be the same for VS Code) Repo Open file TestCodeNavigation.cs, and try to use Go To Definition on symbols in it.

hackerzhuli avatar Jun 21 '25 04:06 hackerzhuli