How do I show reference count in Visual Studio Code?

前端 未结 5 1063
无人及你
无人及你 2021-02-02 07:47

I want to show references count in Visual Studio Code. How can I do it?

5条回答
  •  耶瑟儿~
    2021-02-02 08:24

    Sometimes you don't want to turn it on/off completely, but toggle it on/off with a keyboard shortcut. If so, the following may help:

    1. Install an extension: https://marketplace.visualstudio.com/items?itemName=rebornix.toggle

    2. and configure it for your desires. (Preferences -> Keyboard Shortcuts -> keybindings.json)

    For Example for TypeScript:

    {
        "key": "F4",
        "command": "toggle",
        "when": "editorTextFocus",
        "args": {
            "id": "myChosenIdWhatEverItIs",
            "value": [
                {
                  "typescript.referencesCodeLens.enabled": true,
                },
                {
                  "typescript.referencesCodeLens.enabled": false,
                }
            ]
        }
    }
    

提交回复
热议问题