Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code -- commenting .jsx syntax

I checked previous questions on SO here and here and VS Code's issues here and here.

I still don't know how I can comment jsx syntax in VS Code by cmd + /. I tried syntax JavaScript React and JavaScript Babel and add:

"files.associations": {
        "*.js": "javascriptreact"
    }, 

into user settings. Nothing helped. When I check Developer Tools, there are no error messages.

recording

like image 221
Matt Avatar asked Apr 27 '18 09:04

Matt


2 Answers

If you have Babel ES6/ES7 plugin installed, disable it. Editor comments .jsx syntax by // instead of {/*. You see see the issue here.

like image 113
Andrej Gajdos Avatar answered Oct 11 '22 10:10

Andrej Gajdos


It works for me, Remember Atom has this behavior, but VSCode looks a bit intelligent around this area.

Working

I have no custom file associations defined. Also I am on the latest version of VsCode. Make sure you have no additional addins that takeover and change the behavior

like image 22
Tarun Lalwani Avatar answered Oct 11 '22 10:10

Tarun Lalwani