i've tried every possible ext that add this feature but sadly all have its own issues, so without any hacks or workarounds, here's what we do
- check if pressed key is "enter".
- check if previous line started with a comment char.
- execute the
editor.action.commentLine
command.
- single line comment chars list
- until microsoft/vscode#580 is solved, we have to use the manual way 😞
"autoCommentNextLine.list": [
{
"char": "//",
"languages": [
"php",
"javascript",
"jsonc"
]
},
{
"char": "#",
"languages": [
"python"
]
}
]