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

indents after multiline comment incorrect #35709

Closed
john-coloccia opened this issue Oct 6, 2017 · 3 comments
Closed

indents after multiline comment incorrect #35709

john-coloccia opened this issue Oct 6, 2017 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug editor-autoindent Editor auto indentation issues wont-fix

Comments

@john-coloccia
Copy link

john-coloccia commented Oct 6, 2017

  • VSCode Version: 1.16.1
  • OS Version: Windows 10

Steps to Reproduce:

  1. create a multiline comment
  2. hit enter twice. The first line after the comment is indented properly. the second enter indents to the indent level of the comment, which is usually incorrect.

example:

/*
 *
 *
 */
first enter leaves me here

/*
 *
 *
 */

 hit enter twice, and it indents me here, underneath the asterisk, which is off by a space.

Ideally, if I'm not actively typing in a multiline comment, I would want auto-indent to completely ignore comments altogether as if they're not even there.

@vscodebot vscodebot bot added editor editor-contrib Editor collection of extras labels Oct 6, 2017
@chrmarti chrmarti added editor-autoindent Editor auto indentation issues and removed editor-contrib Editor collection of extras labels Oct 6, 2017
@alexdima alexdima removed their assignment Oct 23, 2017
@rebornix rebornix added the bug Issue identified by VS Code Team member as probable bug label Nov 16, 2017
@alexdima alexdima removed the editor label Nov 23, 2017
@garyking
Copy link

garyking commented Apr 9, 2018

I created a separate issue for this before finding this issue. Here is a relevant GIF I made:

vsc-indent

@MatthisLT
Copy link

Having the same issue with CSS (or SCSS) files, except that the indentation is wrong even on the first line right after the multiline comment.

css-indent-issue

@rebornix
Copy link
Member

rebornix commented Nov 3, 2020

This is due to the limited architecture (regex based indentation rules and only support limited code styles), we may want to consider using formatters if they exist for indenation adjustment (if interested, we can discuss in #19847).

For this particular issue, if the indentation rules are leading to more trouble than having no auto indent, you can set editor.autoIndent to advanced to disable the regex based indentation adjustment. As we don't have an easy good-enough fix for it, we close it for now and explore better solutions through issues like (#19847 and #34621).

@rebornix rebornix closed this as completed Nov 3, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug editor-autoindent Editor auto indentation issues wont-fix
Projects
None yet
Development

No branches or pull requests

6 participants