How to disable codelens in VS code?

I've searched but didn't find any info on how to disable references (or the codelens completely) in the Visual Studio Code, they're quite useless and annoying for me.


Solution 1:

You can enable or disable code lense by setting the editor.codeLens setting in user settings (see https://code.visualstudio.com/Docs/editor/editingevolved#_reference-information for more info).

Solution 2:

Update: in the new settings editor of VSCode, it's as simple as typing codelens in the search and ticking the first checkbox in the results:

enter image description here


For me, the setting that fixed it was:

"editor.codeLens": false

in my user preferences json file.

Solution 3:

Step by step:

1- Press CTRL+SHIFT+P and search for "User Settings", and open settings.json file. This file sits under:

%UserProfile%\AppData\Roaming\Code\User\settings.json

CTRL+SHIFT+P

2- On right panel override setting "editor.codeLens" with "false" value.

editor.codeLens