Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable codelens in VS code?

People also ask

What is CodeLens VS Code?

Visual Studio Code Tips – CodeLens in Visual Studio Code CodeLens is a very useful features for the developer to easy way to identify the Property or Method references in particular file. This require to enables from Settings and below are the steps to require to enable CodeLens in Visual Studio Code Settings.

How do I disable VS Code telemetry?

Disable telemetry reporting# telemetryLevel user setting to off . From File > Preferences > Settings (macOS: Code > Preferences > Settings), search for telemetry , and set the Telemetry: Telemetry Level setting to off . This will silence all telemetry events from VS Code going forward.


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).


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.


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


To specifically disable the references in the C# editor, add this to your User Settings:

"csharp.referencesCodeLens.enabled": false

This specifically hides the number of references in the C# editor while keeping the rest of CodeLens' features intact.

MotKohn also pointed out that you can use javascript.referencesCodeLens.enabled or typescript.referencesCodeLens.enabled below. Make sure you give them some points if that helped!


I disabled it by going to file | preferences | settings

file preferences settings

Finally:

Workspace | Text Editor | (scroll down a little)

enter image description here


For people using any Linux OS:

  1. Go to File > Preferences > Settings
  2. Under drop-down Text Editor, search for Code Lens and disable it.

You can do it using a single click on VS Code. Just install the extension Setting Toggle made by Ho-Wan on VS Code. Once you install, click on T as shown in the image to toggle Codelens.

enter image description here