You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this issue occur when all extensions are disabled?: Yes
VS Code Version: 1.97.2
OS Version: macOS 15.4
Steps to Reproduce:
Open a new .js file in VSCode.
Type let string = '//this is a string'.charAt(0).
Place the cursor anywhere after the // in the string (e.g., between // and this, or after string before .charAt).
Press Enter.
Expected Behavior:
The line should split normally, e.g.: let string = '//this is a string'.charAt(0)
or: let string = '//this is a string' .charAt(0)
Actual Behavior:
VS Code inserts a comment on the next line whenever Enter is pressed after //, breaking the code: let string = '//this // is a string'.charAt(0)
or: let string = '//this is a string' // .charAt(0)
Additional Notes:
This bug occurs when you press Enter after “//” on the same line in a JavaScript file, causing the rest of the line to be treated as a comment, even with all extensions disabled and formatting settings off.
It was discovered during a real scenario with axios.get(“http://localhost/index”).then(). Pressing Enter after “//” in the URL or before “.then()” triggers the bug, which happens often when formatting HTTP request code. For example:
axios.get(“http://local
// host/index”).then()
Or
axios.get(“http://localhost/index”)
// .then()
Strings without “//” (e.g., (‘test’), (’/test’)) split fine.
Tested with default and minimal settings.json—issue persists even on a clean Insiders install.
This isn’t just about obscure string splitting; it disrupts real-world coding like breaking up long URL arguments or promise chains.
The text was updated successfully, but these errors were encountered:
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
.js
file in VSCode.let string = '//this is a string'.charAt(0)
.//
in the string (e.g., between//
andthis
, or afterstring
before.charAt
).Expected Behavior:
let string = '//this is a string'.charAt(0)
or:
let string = '//this is a string' .charAt(0)
Actual Behavior:
let string = '//this // is a string'.charAt(0)
or:
let string = '//this is a string' // .charAt(0)
Additional Notes:
This bug occurs when you press Enter after “//” on the same line in a JavaScript file, causing the rest of the line to be treated as a comment, even with all extensions disabled and formatting settings off.
It was discovered during a real scenario with axios.get(“http://localhost/index”).then(). Pressing Enter after “//” in the URL or before “.then()” triggers the bug, which happens often when formatting HTTP request code. For example:
axios.get(“http://local
// host/index”).then()
Or
axios.get(“http://localhost/index”)
// .then()
Strings without “//” (e.g., (‘test’), (’/test’)) split fine.
Tested with default and minimal settings.json—issue persists even on a clean Insiders install.
This isn’t just about obscure string splitting; it disrupts real-world coding like breaking up long URL arguments or promise chains.
The text was updated successfully, but these errors were encountered: