Visual Studio Code codelens doesn't work on variables

250 views Asked by At

I'm developing an game with c# unity and I'm using Visual Studio Code as IDE. However the codelens doesn't work on variables - only properties, classes.. etc at some point as shown in the screenshot:

enter image description here

I'd appreciate it if you can help me. thank you.

enter image description here

I found C# codelens settings but it must work correctly in the present state.

2

There are 2 answers

2
hyunbae On

I fixed. The problem was occurred because c# extension setting reset and omnisharp setting was not loaded after visual code updated.

0
Lê Hoàng Minh On

The new extension C#(2.x.x) of Visual Studio Code did have a problem. What I tried to fix the problem.

Solution: Downgrade the version of the C# extension to 1.26.0.

  • Step 1: Open Visual Studio Code, click on Extention icon.

  • Step 2: Search C#, probably the current version is 2.x.x.

  • Step 3: Click on the arrow next to uninstall, select install another version.

  • Step 4: Select 1.26.0.

Note: if it requires remove extensions to reinstall C#, just remove all other extensions. Now my references of variables are back.

Downgrade picture