Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indent guides mismatch if statements without braces #47006

Closed
svilenmarkov opened this issue Mar 30, 2018 · 3 comments
Closed

Indent guides mismatch if statements without braces #47006

svilenmarkov opened this issue Mar 30, 2018 · 3 comments
Labels
*as-designed Described behavior is as designed editor-indent-guides Editor indentation guides
Milestone

Comments

@svilenmarkov
Copy link

svilenmarkov commented Mar 30, 2018

Issue Type: Bug

Whenever you have an if statement which does not have braces the indent guides keep going forward rather than stopping after the first line underneath.

edit: the same issue exists with loops and switch statements. For the case of switch statements, the indent guide should stop after the break;.

Example below is in PHP, however it appears to be the same in other languages which allow for braceless if statements.

First image shows how it currently is, second image shows how it should be.

demo

VS Code version: Code 1.21.1 (79b44aa, 2018-03-14T14:46:47.128Z)
OS version: Windows_NT x64 10.0.16299

Reproduces without extensions

@vscodebot
Copy link

vscodebot bot commented Mar 30, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@vscodebot vscodebot bot added editor editor-autoindent Editor auto indentation issues labels Mar 30, 2018
@aeschli aeschli assigned alexdima and unassigned aeschli Apr 3, 2018
@alexdima alexdima added editor-rendering Editor rendering issues feature-request Request for new features or functionality and removed editor editor-autoindent Editor auto indentation issues labels Apr 5, 2018
@alexdima alexdima added this to the Backlog milestone Apr 5, 2018
@alexdima alexdima removed their assignment Apr 5, 2018
@alexdima alexdima added editor-indent-guides Editor indentation guides and removed editor-rendering Editor rendering issues labels Oct 23, 2019
@hediet
Copy link
Member

hediet commented Oct 15, 2021

Indentation guides are language agnostic and only depend on the indentation (nothing else).

Thus, this also has to work:

image

In this screenshot, it does not make sense to interrupt the line from begin to end.

However, by just looking at the indentation, your example matches the example in the screenshot.

image

Thus, by design we cannot draw the indentation guides differently in both cases.

@hediet hediet added *as-designed Described behavior is as designed and removed feature-request Request for new features or functionality labels Oct 15, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Nov 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*as-designed Described behavior is as designed editor-indent-guides Editor indentation guides
Projects
None yet
Development

No branches or pull requests

5 participants
@hediet @alexdima @aeschli @svilenmarkov and others