How to disable codelens in VS code?

前端 未结 8 1286
萌比男神i
萌比男神i 2020-12-24 03:53

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.

相关标签:
8条回答
  • 2020-12-24 04:33

    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.
    0 讨论(0)
  • 2020-12-24 04:35

    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!

    0 讨论(0)
  • 2020-12-24 04:37

    I disabled it by going to file | preferences | settings

    Finally:

    Workspace | Text Editor | (scroll down a little)
    

    0 讨论(0)
  • 2020-12-24 04:45

    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
    

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

    0 讨论(0)
  • 2020-12-24 04:45

    Shortcut to toggle this feature on/off quickly: CTRL+SHIFT+P Toggle TypeLens

    0 讨论(0)
  • 2020-12-24 04:50

    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.

    0 讨论(0)
提交回复
热议问题