Last updated: Apr 6, 2024
Reading time·3 min

References in VS Code are a feature that comes with CodeLens.

The yellow arrow points to a reference count.
You can disable them by disabling CodeLens or disabling specific references.
To disable CodeLens completely:
Ctrl + Shift + P (or Command + Shift + P on macOS).F1 to open the Command Palette.

You can also open the settings screen by pressing Ctrl + , on Windows and
Linux or Cmd + , on macOS.
Once you uncheck the checkbox, the references are no longer shown.
You can also disable references (CodeLens) directly in your settings.json file.
Ctrl + Shift + P (or Command + Shift + P on macOS).F1 to open the Command Palette.Type user settings json.
Click on Preferences: Open User Settings (JSON)

"editor.codeLens" property to false in the object.{ "editor.codeLens": false, }

If you need to disable specific references:
Ctrl + Shift + P (or Command + Shift + P on macOS).F1 to open the Command Palette.

You might also need to disable the MDN hover references in VS Code.

When you hover over an HTML tag or a method, you get some information from the MDN docs.
If you'd rather disable the MDN references:
Ctrl + Shift + P (or Command + Shift + P on macOS).F1 to open the Command Palette.
You can also open the settings screen by pressing Ctrl + , on Windows and
Linux or Cmd + , on macOS.

Once you disable the setting, the MDN references are no longer shown.

When the MDN references are disabled, you will still get helpful information when you hover over a method or a CSS function.

If you'd rather disable all hover references.
Ctrl + Shift + P (or Command + Shift + P on macOS).F1 to open the Command Palette.
You can also open the settings screen by pressing Ctrl + , on Windows and
Linux or Cmd + , on macOS.

When you hover over a tag or a method, you will no longer get pop-ups.

I've also written an article on how to disable/enable hover hints (tooltips) in VS Code.
You can learn more about the related topics by checking out the following tutorials: