LaurentTreguier / vscode-uncrustify

Code format using uncrustify
66 stars 10 forks source link

Error with code formatting on VScode 1.47.1 #68

Closed suratovvlad closed 4 years ago

suratovvlad commented 4 years ago

Updated vscode to the 1.47.1 today. Now, configured "Format Document With...." Uncrustify fails with unknown error.

I checked logs from Extension Host, and found only this:

[2020-07-15 18:58:03.012] [exthost] [error] [LaurentTreguier.uncrustify] provider FAILED
[2020-07-15 18:58:03.012] [exthost] [error] undefined
LaurentTreguier commented 4 years ago

A few questions:

VSCode 1.47.1 is a patch release and apparently only has a single security fix, if the extension broke solely because of it, then it means the update could have gone awr.

suratovvlad commented 4 years ago

Hello, sorry for the late response..

These logs I found in the Output window for Uncrustify, when I enabled debug mode:

Debug: extension started
Debug: registered formatter for modes: c,cpp,csharp,d,java,objective-c,pawn,pde,vala,apex,apex-anon
Debug: temporary directory: C:\Users\VSuratov\AppData\Local\Temp\Visual Studio Code.uncrustify2020623-78188-wrbw38.buec
Debug: temporary file: C:\Users\VSuratov\AppData\Local\Temp\Visual Studio Code.uncrustify2020623-78188-wrbw38.buec\entitycolumniteratortests.cpp
Debug: config file: C:\viadat\baselibs\develop_rel\config\uncrustify.cfg
Debug: launched: C:\viadat\baselibs\develop_rel\bin\uncrustify.exe -l CPP -c C:\viadat\baselibs\develop_rel\config\uncrustify.cfg --replace --no-backup C:\Users\VSuratov\AppData\Local\Temp\Visual Studio Code.uncrustify2020623-78188-wrbw38.buec\entitycolumniteratortests.cpp
Debug: uncrustify exited with error: Parsing: C:\Users\VSuratov\AppData\Local\Temp\Visual Studio Code.uncrustify2020623-78188-wrbw38.buec\entitycolumniteratortests.cpp as language CPP

Debug: uncrustify exited with status: 0

Meanwhile I execute uncrustify from command line, and it works without a problem with the same parameters for actual file, not in the Temp folder: -l CPP -c C:\viadat\baselibs\develop_rel\config\uncrustify.cfg --replace --no-backup

suratovvlad commented 4 years ago

I discovered that with these two options this plugin doesn't work: "uncrustify.useTempFile": true, and "uncrustify.useReplaceOption": true. I tried to execute with them one by one, and with both options enabled, same result error

Debug: extension started
Debug: registered formatter for modes: c,cpp,csharp,d,java,objective-c,pawn,pde,vala,apex,apex-anon
Debug: temporary directory: C:\Users\VSuratov\AppData\Local\Temp\Visual Studio Code.uncrustify2020623-87836-1kd0dzo.xlf2
Debug: temporary file: C:\Users\VSuratov\AppData\Local\Temp\Visual Studio Code.uncrustify2020623-87836-1kd0dzo.xlf2\entity.hpp
Debug: config file: C:\viadat\baselibs\develop_rel\config\uncrustify.cfg
Debug: launched: C:\viadat\baselibs\develop_rel\bin\uncrustify.exe -l CPP -c C:\viadat\baselibs\develop_rel\config\uncrustify.cfg --replace --no-backup C:\Users\VSuratov\AppData\Local\Temp\Visual Studio Code.uncrustify2020623-87836-1kd0dzo.xlf2\entity.hpp
Debug: uncrustify exited with error: Parsing: C:\Users\VSuratov\AppData\Local\Temp\Visual Studio Code.uncrustify2020623-87836-1kd0dzo.xlf2\entity.hpp as language CPP

Debug: uncrustify exited with status: 0
Debug: config file: C:\viadat\baselibs\develop_rel\config\uncrustify.cfg
Debug: launched: C:\viadat\baselibs\develop_rel\bin\uncrustify.exe -l CPP -c C:\viadat\baselibs\develop_rel\config\uncrustify.cfg
Debug: uncrustify exited with error: Parsing: 21891 bytes (21891 chars) from stdin as language CPP

Debug: uncrustify exited with status: 0
Debug: temporary file: C:\Users\VSuratov\AppData\Local\Temp\Visual Studio Code.uncrustify2020623-87836-1kd0dzo.xlf2\entity.hpp
Debug: config file: C:\viadat\baselibs\develop_rel\config\uncrustify.cfg
Debug: launched: C:\viadat\baselibs\develop_rel\bin\uncrustify.exe -l CPP -c C:\viadat\baselibs\develop_rel\config\uncrustify.cfg --replace --no-backup C:\Users\VSuratov\AppData\Local\Temp\Visual Studio Code.uncrustify2020623-87836-1kd0dzo.xlf2\entity.hpp
Debug: uncrustify exited with error: Parsing: C:\Users\VSuratov\AppData\Local\Temp\Visual Studio Code.uncrustify2020623-87836-1kd0dzo.xlf2\entity.hpp as language CPP

Debug: uncrustify exited with status: 0
Debug: config file: C:\viadat\baselibs\develop_rel\config\uncrustify.cfg
Debug: launched: C:\viadat\baselibs\develop_rel\bin\uncrustify.exe -l CPP -c C:\viadat\baselibs\develop_rel\config\uncrustify.cfg --replace --no-backup c:\viadat\projects\develop_cmake\baselibs\src\core\sql\entity.hpp
Debug: uncrustify exited with error: Parsing: c:\viadat\projects\develop_cmake\baselibs\src\core\sql\entity.hpp as language CPP

Debug: uncrustify exited with status: 0
Debug: config file: C:\viadat\baselibs\develop_rel\config\uncrustify.cfg
Debug: launched: C:\viadat\baselibs\develop_rel\bin\uncrustify.exe -l CPP -c C:\viadat\baselibs\develop_rel\config\uncrustify.cfg --replace --no-backup c:\viadat\projects\develop_cmake\baselibs\src\core\sql\entity.hpp
Debug: uncrustify exited with error: Parsing: c:\viadat\projects\develop_cmake\baselibs\src\core\sql\entity.hpp as language CPP

Debug: uncrustify exited with status: 0
Debug: temporary file: C:\Users\VSuratov\AppData\Local\Temp\Visual Studio Code.uncrustify2020623-87836-1kd0dzo.xlf2\entity.hpp
Debug: config file: C:\viadat\baselibs\develop_rel\config\uncrustify.cfg
Debug: launched: C:\viadat\baselibs\develop_rel\bin\uncrustify.exe -l CPP -c C:\viadat\baselibs\develop_rel\config\uncrustify.cfg --replace --no-backup C:\Users\VSuratov\AppData\Local\Temp\Visual Studio Code.uncrustify2020623-87836-1kd0dzo.xlf2\entity.hpp
Debug: uncrustify exited with error: Parsing: C:\Users\VSuratov\AppData\Local\Temp\Visual Studio Code.uncrustify2020623-87836-1kd0dzo.xlf2\entity.hpp as language CPP

Debug: uncrustify exited with status: 0
Debug: config file: C:\viadat\baselibs\develop_rel\config\uncrustify.cfg
Debug: launched: C:\viadat\baselibs\develop_rel\bin\uncrustify.exe -l CPP -c C:\viadat\baselibs\develop_rel\config\uncrustify.cfg
Debug: uncrustify exited with error: Parsing: 21930 bytes (21930 chars) from stdin as language CPP

Debug: uncrustify exited with status: 0
Debug: config file: C:\viadat\baselibs\develop_rel\config\uncrustify.cfg
Debug: launched: C:\viadat\baselibs\develop_rel\bin\uncrustify.exe -l CPP -c C:\viadat\baselibs\develop_rel\config\uncrustify.cfg --replace --no-backup c:\viadat\projects\develop_cmake\baselibs\src\core\sql\entity.hpp
Debug: uncrustify exited with error: Parsing: c:\viadat\projects\develop_cmake\baselibs\src\core\sql\entity.hpp as language CPP

Debug: uncrustify exited with status: 0
Debug: temporary file: C:\Users\VSuratov\AppData\Local\Temp\Visual Studio Code.uncrustify2020623-87836-1kd0dzo.xlf2\entity.hpp
Debug: config file: C:\viadat\baselibs\develop_rel\config\uncrustify.cfg
Debug: launched: C:\viadat\baselibs\develop_rel\bin\uncrustify.exe -l CPP -c C:\viadat\baselibs\develop_rel\config\uncrustify.cfg --replace --no-backup C:\Users\VSuratov\AppData\Local\Temp\Visual Studio Code.uncrustify2020623-87836-1kd0dzo.xlf2\entity.hpp
Debug: uncrustify exited with error: Parsing: C:\Users\VSuratov\AppData\Local\Temp\Visual Studio Code.uncrustify2020623-87836-1kd0dzo.xlf2\entity.hpp as language CPP

Debug: uncrustify exited with status: 0