Search Unity

Can I configure Visual Studio (or any other IDE) to jump to the ECS source?

Discussion in 'Entity Component System' started by frankfringe, Apr 18, 2019.

  1. frankfringe

    frankfringe

    Joined:
    Feb 9, 2019
    Posts:
    105
    When I CTRL + Click on something it does not go to the source code but infers headers from metadata. I would like to also be able to go to the source code sometimes. Is that possible?
     
    SamOld likes this.
  2. NoDumbQuestion

    NoDumbQuestion

    Joined:
    Nov 10, 2017
    Posts:
    186
    Try Ctrl shift F or Shift F12
     
  3. yossi_horowitz_artie

    yossi_horowitz_artie

    Joined:
    Jan 30, 2019
    Posts:
    87
    The problem is that Unity's built-in generation of Visual Studio solutions doesn't appear to create projects for assemblies that are in external packages.
     
  4. frankfringe

    frankfringe

    Joined:
    Feb 9, 2019
    Posts:
    105
    Did you get around that somehow?
     
  5. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    Rider supports this by default, resharper adds this to visual studios.
     
    frankfringe likes this.
  6. yossi_horowitz_artie

    yossi_horowitz_artie

    Joined:
    Jan 30, 2019
    Posts:
    87
    No; I have VSCode open and pointing to the my package cache folder so I can do Find in Files when I need to look at the source, but it's definitely not good enough.
     
  7. yossi_horowitz_artie

    yossi_horowitz_artie

    Joined:
    Jan 30, 2019
    Posts:
    87
    Good to know; odd that this isn't something that VSTU handles, though.
     
  8. yossi_horowitz_artie

    yossi_horowitz_artie

    Joined:
    Jan 30, 2019
    Posts:
    87
    Another not-good-enough-but-better-than-nothing-and-still-free solution:

    Install ILspy -- https://marketplace.visualstudio.com/items?itemName=SharpDevelopTeam.ILSpy ; it adds a right-click menu option that you can can you to go to decompiled source.
     
    frankfringe likes this.
  9. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    Yeah ILSpy probably best free solution. I've tried it and it works ok but I had to go back. I can't live without the Rider/Resharper decompile functionality anymore.
     
    JesOb and eizenhorn like this.
  10. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    2,685
    Yep I’m switched from many years of VS to Ruder half year ago, It’s definitely better.
     
  11. yossi_horowitz_artie

    yossi_horowitz_artie

    Joined:
    Jan 30, 2019
    Posts:
    87
    Is the lack of packages assemblies in Visual Studio (without Resharper) a bug? Should I report it to somebody? And if so -- Microsoft, or Unity?
     
  12. BrendonSmuts

    BrendonSmuts

    Joined:
    Jun 12, 2017
    Posts:
    86
    I think you could consider it a missing feature, not a bug. It certainly would be nice to be able to double click a package source file and open the assembly as an actual project.
     
    Last edited: Apr 26, 2019
    SamOld likes this.
  13. SamOld

    SamOld

    Joined:
    Aug 17, 2018
    Posts:
    333
    I wouldn't say it's a bug exactly, but a consequence of how Unity does packages. They're not part of the VS solution. They're loaded as DLLs. The source code happens to be available in the PackageCache folder and Unity loads the files from there when asked, but VS doesn't have any way to know to go look there.

    Resharper adds a feature to VS that lets you give it extra places outside of the solution to look for sources. It would be nice if VS had this as a core feature but it doesn't for now.

    Unity might be able to address this by changing how they load packages into the solution. I'm not sure if there's a feasible fix there.

    There's also Visual Studio Tools for Unity. That may be able to add support to VS if there's an available extension point. Resharper obviously achieves it somehow, but I'm not sure whether they've used an easy extension point or re-implemented the whole go to source feature.