#20985·orca

[Bug]: Toggle Line Comment emits invalid `//` comments in JSX and TSX children

Author: 100spaceCreated Sep 16, 2026Updated Sep 17, 2026
Labelsbugos:macos
### Operating system macOS ### Orca version v1.4.202 ### Details ## Short summary Using **Toggle Line Comment** (`Cmd+/` on macOS or `Ctrl+/` on Linux/Windows) inside JSX children in `.jsx` and `.tsx` files inserts JavaScript `//` comments. `//` is valid in JavaScript and TypeScript regions, but it is not JSX child comment syntax. JSX children need to be wrapped in `{/* ... */}`. ## What happened? Given this TSX: ```tsx const view = (

Hello

) ``` Selecting the `

` line and pressing `Cmd+/` produces: ```tsx const view = ( //

Hello

) ``` The same problem affects multiline selections: Monaco prefixes each selected JSX line with `//`, leaving invalid JSX. ## How can we reproduce it? 1. Open a `.jsx` or `.tsx` file in Orca's code editor. 2. Put a JSX element inside another element. 3. Select one JSX child line, or multiple consecutive JSX child lines. 4. Press `Cmd+/` on macOS or `Ctrl+/` on Linux/Windows. 5. Observe that Orca inserts `//` instead of a JSX comment. ## Expected behavior A single JSX child line should become: ```tsx {/*

Hello

*/} ``` A multiline JSX child selection should become one valid JSX comment: ```tsx {/*

First

Second

*/} ``` JavaScript and TypeScript statements in the same file should continue to use `//`. Other languages should keep Monaco's existing comment syntax, such as `--` for SQL, `#` for Python, `` for HTML, and `/* ... */` for CSS. ## Visual comparison ### Current default output ### Expected contextual output ## Additional context The current behavior comes from Monaco's language-wide line-comment configuration. A `.jsx` or `.tsx` model uses JavaScript/TypeScript comment tokens for the entire file, so the default action does not distinguish JSX children from surrounding code. The fix should remain contextual and preserve Monaco's default action outside JSX children rather than replacing comment text after the edit.