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

Bug: Incorrect indenting of same level lines #114

Closed
SkyaTura opened this issue Sep 24, 2020 · 5 comments
Closed

Bug: Incorrect indenting of same level lines #114

SkyaTura opened this issue Sep 24, 2020 · 5 comments
Labels
wontfix The issue is expected and will not be fixed

Comments

@SkyaTura
Copy link
Collaborator

Info

Tool Version
Plugin v1.6.1
Prettier v2.1.1
Node v10.16.3
OS mac

Input

  div
  div
  div

Output or Error

div
  div
  div

Expected Output

div
div
div

Additional Context

I think it is self explained by the examples why this is an error.

@Shinigami92
Copy link
Member

Will look into it, but don't know if I will fix this if this is hard to fix, cause you can easily workaround that by manually check the indentation

@Shinigami92
Copy link
Member

I'm getting this token stream:

[
  { "type": "tag",     "loc": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 4 } }, "val": "div" },
  { "type": "indent",  "loc": { "start": { "line": 2, "column": 1 }, "end": { "line": 2, "column": 3 } }, "val": 2     },
  { "type": "tag",     "loc": { "start": { "line": 2, "column": 3 }, "end": { "line": 2, "column": 6 } }, "val": "div" },
  { "type": "newline", "loc": { "start": { "line": 3, "column": 1 }, "end": { "line": 3, "column": 3 } }               },
  { "type": "tag",     "loc": { "start": { "line": 3, "column": 3 }, "end": { "line": 3, "column": 6 } }, "val": "div" },
  { "type": "outdent", "loc": { "start": { "line": 4, "column": 1 }, "end": { "line": 4, "column": 1 } }               },
  { "type": "eos",     "loc": { "start": { "line": 4, "column": 1 }, "end": { "line": 4, "column": 1 } }               }
]

So as you can see, it is technically a problem of pug itself 🙁
If you want you can try to fix that, but I don't think is will help much and just add much complexity to the processing...
So if you are satisfied with just handling this manually and remove these indents by yourself (e.g. using IDEs multicurser functionality), I vote for labeling this issue as wontfix

@SkyaTura
Copy link
Collaborator Author

How about adding wontfix and a note on documentation? To warn people when they choose to implement this on already existing codebases.

@Shinigami92
Copy link
Member

That I can definitely do!

@Shinigami92 Shinigami92 added the wontfix The issue is expected and will not be fixed label Sep 26, 2020
@Shinigami92
Copy link
Member

72f2bee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix The issue is expected and will not be fixed
Projects
None yet
Development

No branches or pull requests

2 participants