Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Which VS extension shows "references"?

Discussion in 'Scripting' started by kirrwed, Feb 26, 2022.

  1. kirrwed

    kirrwed

    Joined:
    Jan 15, 2022
    Posts:
    12
    Does anyone know which extension people have in Visual Studio that shows them the little "references" info in the code? And if you rollover it, it will show you exactly where in that script or other script the reference(s) are.
     

    Attached Files:

  2. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    1,763
  3. gfrast

    gfrast

    Joined:
    May 5, 2014
    Posts:
    30
    @kirrwed this looks like Rider to me. At least Rider has some similar featuers.
    I can only recommend it. I made the switch from Visual Studio a while ago and never looked back.

    Check it out here: https://www.jetbrains.com/lp/dotnet-unity/

    On a sidenote, this question probably shouldn't be in the Visual Scripting Sub-forum. I guess you accidently mixed Visual Scripting and Visual Studio up here :)
     
    kirrwed likes this.
  4. Trindenberg

    Trindenberg

    Joined:
    Dec 3, 2017
    Posts:
    380
    I have References show since VStudio 2019. Not sure if built in, or part of ReSharper
     
  5. iMobCoding

    iMobCoding

    Joined:
    Feb 13, 2017
    Posts:
    160
    It's called Code Lens in Visual Studio. It should be enabled by default, but if not, it's located in Options / Text Editor / All Languages / CodeLens
     
    Last edited: Feb 27, 2022
  6. kirrwed

    kirrwed

    Joined:
    Jan 15, 2022
    Posts:
    12
    Thank you. I seem to have had CodeLens checked already. I unchecked it, rechecked, and restarted the app but still no in-line references like in my opening screenshot. Does that make any sense? Any other idea?
     

    Attached Files:

  7. iMobCoding

    iMobCoding

    Joined:
    Feb 13, 2017
    Posts:
    160
    That's not Visual Studio, it's Visual Studio Code you're using. I don't have experience with it so can't help you much, but check common things when working with Unity and VSC:

    - Check if you installed .NET SDK https://dotnet.microsoft.com/download
    - Check if you installed C# for VSC extension inside Code editor
    - In Unity install latest Visual Studio Code Editor package from Package Editor
    - In Unity set VSC to be the External Script Editor and click once the "Reset Argument" button. Also click once the "Regenerate project files" button. All of this is in Unity / Preferences / External Tools
    - After that close and restart both - the VSC and Unity

    If this doesn't help try searching something like "Code lens doesn't show in visual studio code for unity"
     
    kirrwed likes this.