Closed crupest closed 4 years ago
@crupest i confirmed the bug, i think i just need to replace \n
with \r?\n
in all my regex's so this should be an easy fix.
I'm not quite familiar with formatter internals. Your fix is reasonable. I think a good start would be to write some unit tests against this, which I could help do if I have time.
And if all existing unit tests pass after your fix is applied, it might be ok!
thanks but that not necessary, i added the info as a reminder for me so that i know what i have to do.
That would be nice then! Thank you for your devotion!😁
@crupest it works now in the formatter i just need to update the extension, im not sure if i can use the line endings from vscode or if you have to select the line ending manually in any case new version should be up in a less that a hour.
It would be better if formatter could keep the original line ending. So I think it is not necessary to use it from vscode as long as vscode passes the original line ending to extension. Whatever, giving the correct format is more important and line ending change is trivial, whose only concern is unnecessary change in git history.
Describe the bug Some necessary indent is removed when the file's line ending is
crlf
. When I change it tolf
, it works right. I' m not sure it is a bug of formatter or some conflict of extensions, maybe, or other things.To Reproduce Create a file with
.sass
extension in name. Make sure line ending iscrlf
. Add following code:Then format, it turns to
Undo format and change the file line ending to
lf
. Then format again. It remains the correct format.Expected behavior In
crlf
, it should be formatted toScreenshots No.
Desktop (please complete the following information):
1.8.11
Additional context Some other extensions I used which might interfere:
prettier
EditorConfig
(Update: I tried to disable two extensions above, the bug remained.)
Preferences related are all default.
By the way, VS Code version is
1.49.2
.