Search code examples
c#visual-studiocodelens

Not showing git info Codelens in visual studio 2022


In my Visual Studio Community 2022, Codelens doesn't show options related to git.

Tools > Options > Text Editor > All Languages > CodeLens

My visaul studio doesn't have these options.

  • Show Timeline (Git)
  • Show Authors & Changes (Git)

Not show this options (img)

It shows "0 references" on classes and methods but not "git changes and author"(0 changes | 0 authors)

    0 refernces // but not show => 0 changes | 0 authors
    public void HelloWord()
    {
       Console.WriteLine("Hello Word");
    }

my problem here (img)

I want it to be so.

I want it here (img)

    0 refernces | 0 changes | 0 authors
    public void HelloWord()
    {
       Console.WriteLine("Hello Word");
    }

What do I have to do?


Solution

  • This feature is available in Visual Studio 2022 Professional, and some features are not supported in the community version.

    Tools > Options > Text Editor > All Languages > CodeLens
    

    After that, make sure you check Enable Code Lens at the very top of the window and restart your Visual Studio.

    enable codelens