welkineins / vscode-astyle

Format C/C++/Obj-C code with Astyle in VSCode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

does upgrade 1.9 of vscode broke the plugin

ccinv opened this issue · comments

Hi.
Today I upgrade Astyle to 2.06 and vscode to 1.9.And evidently either of them broke the formatter.Then I switch astyle to old 2.05,the problem is still.
Issue:
snipaste20170204_110144
snipaste20170204_110234
snipaste20170204_110258

It seems somethings changed in vscode 1.9. I'm looking for the problem now.

vscode 1.9.1 fixed this

I have the same problem with VSCode 1.9.1 and astyle 3. An empty lined is added to every other line in the file. This gets repeated every time formatting is invoked.

Edit: I had the same problem with VSCode 1.8.x, which made me upgrade my VSCode to 1.9.1, but it didn't fix the problem. Using older (2.x) version of astyle makes no difference either.

The problem still exists, and it seems to be related to files with LF line endings, at least on Windows. CRLF works fine. Tested using VS Code 1.12.2 and AStyle 3 on a Windows 10 machine.

Hi @strike-zero,

Can you try add line ending options in astylerc?

--lineend=windows OR -z1
--lineend=linux OR -z2
--lineend=macold OR -z3
Force use of the specified line end style. Valid options
are windows (CRLF), linux (LF), and macold (CR).

thanks

@welkineins
I tried with all of the line ending options with the same results. Unless you change the end of line sequence from LF to CRLF in VS Code itself, the bug will occur.

Also one thing to note from the AStyle docs:
"When redirection is used on Windows the output will always have Windows line ends. This option (referring to line ending options) will be ignored."

Seems need to be reopen?

commented

I have the same problem

Environment version
Visual Studio Code version 1.13.1
Astyle extension version 0.6.2
Astyle binary 3.0.1
Windows OS Win10 x64

Hi guys,

I finally have time to update the way to handle newline issue. Please help me to test if it's fix on 0.7.0. Hopes it does!

Thanks.

I gave it a quick test, and unfortunately it's still not fixed. I have also tried with all the line ending options.

Hi @strike-zero,

Thanks with the quick test. But sorry I didn't fix it in 0.7.0.
I take other steps trying to fix the issue in 0.7.1.

Can you help to run the test again?

Thanks

Happy to report that the issue is finally fixed!
Thank you for the quick update.