This Visual Studio Code extension adds a floating button next to JavaScript variable declarations. When clicked, it inserts a console.log
statement to log the variable and any inline comment.
- Detects
const
,let
, andvar
variable declarations. - Adds a floating
[Log]
button next to the variable declaration. - Inserts a
console.log
statement below the variable declaration when the button is clicked.
- Clone the repository or download the extension.
- Open the project in Visual Studio Code.
- Run
npm install
to install the dependencies. - Press
F5
to start the extension in a new Extension Development Host.
- Open a JavaScript file in Visual Studio Code.
- Place the cursor on a line with a variable declaration (
const
,let
, orvar
). - Observe the
[Log]
button appearing next to the variable declaration. - Click on the
[Log]
button to insert aconsole.log
statement below the variable, including any inline comments.
const myVariable = 42; // This is my variable
// After clicking the [Log] button, the following line will be added:
console.log('myVariable: This is my variable', myVariable);
- Visual Studio Code
- Node.js
This extension does not require any additional settings.
- The [Log] button may not appear if the variable declaration is not detected correctly.
1.0.0
- Initial release of the Log Variable Extension.
If you have any suggestions or find any issues, please feel free to open an issue or submit a pull request.
This project is licensed under a custom license. See the LICENSE file for details.