This extension is based on Ben White extension (https://github.com/whtouche/vscode-js-console-utils).
VSCode extension. Easily insert console statements., by N-Iwata(@rpf_nob)
Visual Studio Code 1.67.0 later
This extension is available for free in the Visual Studio Code Marketplace
With selection or cursor into the variable(Anything is OK):
- Press Cmd+Shift+L => The output on a new line will be: console.log('variable: ', variable);
- Press Cmd+Shift+T => The output on a new line will be: console.table(variable);
- Press Cmd+Shift+W => The output on a new line will be: console.warn('variable: ', variable);
- Press Cmd+Shift+E => The output on a new line will be: console.error('variable: ', variable);
Without selection:
- Press Cmd+Shift+L => The output on the same line will be: console.log();
- Press Cmd+Shift+T => The output on the same line will be: console.table();
- Press Cmd+Shift+W => The output on the same line will be: console.warn();
- Press Cmd+Shift+E => The output on the same line will be: console.error();
for windows Ctrl+Shift+・・・
only .js, .jsx, .ts, .tsx, .vue, .svelte, .html file supported.
Enabled to color the text of console.log.
settings < extensions < JavaScript Insert Console < js-console.textColor
example
console.log('%c name: ', 'color: #112233', name);
Choose to have a semicolon or not.
settings < extensions < JavaScript Insert Console < js-console.endWithSemicolon
Choose single quorts or double quorts.
settings < extensions < JavaScript Insert Console < js-console.useSingleQuotes
Feel free to make a pull request to the main branch to fix any bugs or suggestions for improvement.
Feel free to create an issue if you have any problems or requests for improvement.