CREDITS: Thanks to M-coder, for the original extension.
Easily insert and comment console.log statements.
It's true, there are already a lot of extensions to write console.logs quickly and I have used some. However, as I used it I felt a need to add some small features so that the extension suited me perfectly.
Here are some of the available features:
- writes a console.log just by placing the cursor on the word (without needing to select it).
- automatically detects if the file is encoded with semicolons.
- manages the indentation in an optimized way (a bit complicated to explain in one line but do the experiment)
- if you select an object with its curly brackets, the extension logs the whole object. Destructured objects and arrays continue to write a separate console.log for each item.
- allows to toggle comments on all console.log statements in a file with one keyboard shortcut
- removes both active and commented console.log statements from a file
- if the cursor is not placed on text then it will simply write "console.log()"
This extension is available for free in the Visual Studio Code Marketplace.
Press Cmd+Shift+L => The output (on a new line) will be: console.log('variable: ', variable);
Press Cmd+Shift+L => The output (on the same line) will be: console.log();
Press Cmd+Shift+C => This toggles comments on all console.log statements in the current file.
Press Cmd+Shift+D => This removes all active and commented console.log statements in the current file.
MIT License

