-
Notifications
You must be signed in to change notification settings - Fork 38k
Closed
Labels
*duplicateIssue identified as a duplicate of another issue(s)Issue identified as a duplicate of another issue(s)editor-renderingEditor rendering issuesEditor rendering issues
Description
Visual Examples
Allman Style Indentation
K&R Style Indentation
Simple Code Block
Whitesmiths Style Indentation
Steps to Reproduce:
- Create a new JavaScript or TypeScript file.
- Set the Language/Syntax Highlighting to "TypeScript".
- Add the following to the file:
function test() { if (window !== undefined) { console.log("Allman style"); } if (window !== undefined) { console.log("K&R style"); } { console.log("Simple block"); } if (window !== undefined) { console.log("Whitesmiths style"); } }
- Put the cursor at the bracket on lines 4, 6, 8, and 10. Verify that the highlighted Indent Guide is NOT associated with the associated
ifstatement, but thefunctionstatement on line 1. - Move the cursor to the bracket on line 12 or 14. Verify that the highlighted Indent Guide is Not associated with the brackets that define the block, but the encapsulating
functionstatement on line 1. - Move the cursor to the bracket on line 13. Verify that the highlighted Indent Guide is associated with the
ifstatement on line 12.
Discussion
As a user who prefers the Allman indentation style I expect that placing the cursor on a bracket (both opening and closing) associated with a specific block will result in highlighting the block associated with that bracket rather than the encapsulating block. As the reproduction steps show, this also fails with the K&R style and with simple code blocks.
This does work as expected with the Whitesmiths style, the GNU, and likely with any other style that indents the brackets themselves beneath the encapsulating statement.
Environment
Does this issue occur when all extensions are disabled?: Yes
- VSCode Version: 1.2.5.0
- OS Version: macOS 10.13.5
Reactions are currently unavailable
Metadata
Metadata
Labels
*duplicateIssue identified as a duplicate of another issue(s)Issue identified as a duplicate of another issue(s)editor-renderingEditor rendering issuesEditor rendering issues



