skip to Main Content

Right now the vscode is able to transform any identifier to the following cases but not pascal case:
enter image description here

How to add pascal case to the supported cases?

tried ctr+shift+p and then typed "transform to pascal case"
expected to see the "transform to pascal case" in the supported cases

2

Answers


  1. It’s not supported ATM.
    But there’s a tracking issue on github to whether add this feature.
    Upvote this github issue in order to vscode devs consider this as a feature request.

    Login or Signup to reply.
  2. Snippets do have a pascalcase transform so you could make either these keybindings:

    // with cursor at the end of the identifier
    
    {
      "key": "alt+p alt+c",        // whatever keybinding you want
      "command": "runCommands",
      "args": {
        "commands": [
          "cursorHomeSelect",       
          {
            "command": "editor.action.insertSnippet",
            "args": {
              "snippet": "${TM_SELECTED_TEXT/(.*)/${1:/pascalcase}/}"
            }
          }
        ]
      }
    },
    
    // you select the identifier first for the below keybinding
    
    {
      "key": "alt+p alt+c",          // whatever keybinding you want
      "command": "editor.action.insertSnippet",
      "args": {
        "snippet": "${TM_SELECTED_TEXT/(.*)/${1:/pascalcase}/}"
      }
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search