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

Question Using F12 doesn't allow tracking to the function definition.(Via Vs2022)

Discussion in 'Entity Component System' started by Bagazi, Aug 22, 2023.

  1. Bagazi

    Bagazi

    Joined:
    Apr 18, 2018
    Posts:
    609
    I'm using VS2022 as my development IDE, and sometimes when I use F12, I can't track to the function definition (library functions within Unity.Entities). It feels like it's taking me to a place I don't quite understand. I have installed the "com.unity.ide.vscode": "1.2.5" package. Could it be due to the settings?


    upload_2023-8-23_2-44-57.png


    Jump to
    upload_2023-8-23_2-44-38.png
     
  2. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,292
    It takes you to the Baker implementation. Usually VS is quite quirky when it comes to the package code navigation.

    Try Jetbrains Rider, its way better in every aspect, if you can afford it.
     
    Bagazi likes this.
  3. uvTwitch

    uvTwitch

    Joined:
    Sep 14, 2014
    Posts:
    1

    Try using Alt-F12 to open a code lens window while your cursor is over the function name; it'll show that function in-line, with full editability. Unless I misremember, F12 on it's own jumps to the definition of the owning class's interface, and Ctrl-F12 to the implementation of it.

    Rider lacks a lot of quality of life features like this, and a scrollbar minimap, and is in my experience quite often misleading or outright wrong with it's suggestions - I'd recommend sticking with Visual Studio if you don't feel the need for training wheels.
     
    Bagazi likes this.