Typescript: Commenting out in tsx file

Created on 16 Jun 2016  路  10Comments  路  Source: microsoft/TypeScript

_From @wallverb on June 14, 2016 13:22_

Right now when I use cmd+/ in tsx file in jsx part of the file:

eg. on second line of:

<div>
  <div>...</div>
</div>

then it will convert it to

<div>
  // <div>...</div>
</div>

It would be awesome if it could turn it into

<div>
{/* <div>...</div> */}
</div>

_Copied from original issue: Microsoft/vscode#7658_

API Fixed Suggestion VS Code Tracked

Most helpful comment

I'm still facing this issue in latest VSCode.

All 10 comments

I guess we never thought of this one. the assumption now that a comment in TS is always adding //. we will need to make it based on syntactic context. so we will need a new API on the LS side to do that, possibly getCommentEdits and getUncommentEdits to do the two operations based on context.

vscode now comments with the right syntax inside of tsx, so I guess this should be closed.

@radix, for me it does not... VScode 1.13.1

Still have JSX comment problem in VSCode 1.14.2, any updates?

also have this issue... did anyone find a solution?

This should be fixed in VS Code 1.19:

dec-21-2017 16-19-18

Please report any additional issues around jsx commenting against VS Code: https://github.com/Microsoft/vscode/issues/new

What about regular Visual Studio?

I'm still facing this issue in latest VSCode.

same problem with 1.23.1

Version 1.23.1
Commit d0182c3417d225529c6d5ad24b7572815d0de9ac
Date 2018-05-10T17:11:17.614Z
Shell 1.7.12
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64

Since this is a VS-specific feature i would add a comment on the VS issue tracking that under https://developercommunity.visualstudio.com/content/problem/50528/jsx-comment-syntax-is-incorrect.html

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Roam-Cooper picture Roam-Cooper  路  3Comments

Antony-Jones picture Antony-Jones  路  3Comments

seanzer picture seanzer  路  3Comments

jbondc picture jbondc  路  3Comments

MartynasZilinskas picture MartynasZilinskas  路  3Comments