1

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.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
hyunbae
  • 11
  • 1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Aug 07 '23 at 06:20
  • is what's shown in your screenshot really variables? Aren't those class fields? – starball Aug 09 '23 at 07:12

2 Answers2

3

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

0

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

hyunbae
  • 11
  • 1
  • so what did you do to fix the issue? – starball Aug 09 '23 at 07:11
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 09 '23 at 09:54