DEV Community

Discussion on: VS Code extensions you may not have heard of before

Collapse
 
nans profile image
Nans Dumortier

Turbo Console Log inserts console.log snippets quickly into your code. Select a variable you would like to debug, type ctrl + alt + l, and the extension will automatically insert a line to log the variable.
I actually made a custom snippet for that, because I didn't know this kind of extension existed !
GIF
Here is the config I have:

  {
    "key": "cmd+k cmd+l",
    "command": "editor.action.insertSnippet",
    "when": "editorTextFocus",
    "args": {
      "langId": "javascript",
      "name": "Print to console"
    }
  },

And the snippet itself :

"Print to console": {
        "prefix": "log",
        "body": [
            "console.log('$1', ${TM_SELECTED_TEXT});",
        ],
        "description": "Log output to console"
    }