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

Unexpected indentation after empty element and attribute #159

Closed
itn3000 opened this issue Jun 26, 2019 · 2 comments · Fixed by #171
Closed

Unexpected indentation after empty element and attribute #159

itn3000 opened this issue Jun 26, 2019 · 2 comments · Fixed by #171
Assignees
Labels
bug Something isn't working formatting
Milestone

Comments

@itn3000
Copy link

itn3000 commented Jun 26, 2019

Environment

  • win8.1 x64
  • vscode: 1.35.1
  • redhat.vscode-xml: 0.7.0

Steps to reproduce

  1. write empty body element and add attribute, like <A B=""/>
  2. enter the end of element

Expected result

same indentation to element like here(_ is cursor)

<A B=""/>
_

Actual result

one indentation is added like here(_ is cursor)

<A B=""/>
    _

Additionally, without attribute, this is not reproduced, and formatting with Shift+Alt+f, indentation will be adjusted.

@angelozerr
Copy link
Contributor

Indeed I can reproduce the problem but I don't don't know what is the problem?

  • I tried to disable the vscode-xml extension and problem disappear.
  • the lsp4xml doesn't manage this kind of features
  • I suspect problem comes from client side in vscode-xml but I don't know where is the problem?

@xorye could you see this issue please when you will have time?

@fbricon fbricon added bug Something isn't working formatting labels Jul 3, 2019
@fbricon fbricon added this to the 0.8.0 milestone Jul 3, 2019
@fbricon
Copy link
Collaborator

fbricon commented Jul 4, 2019

Must be an issue in the increaseIndentPattern:

increaseIndentPattern: /<([-_\.A-Za-z0-9]+)(?=\s|>)\b[^>]*>(?!.*<\/\1>)|<!--(?!.*-->)|\{[^}"']*$/,

@angelozerr angelozerr changed the title unexpected indentation after empty element + attribute Unexpected indentation after empty element and attribute Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working formatting
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants