LaurentTreguier / vscode-uncrustify

Code format using uncrustify
66 stars 10 forks source link

Uncrustify exists with Error: Debug: uncrustify exited with error: Parsing: 947 bytes (947 chars) from stdin as language JAVA #31

Open Szandor72 opened 6 years ago

Szandor72 commented 6 years ago

I am using current VS Code and have uncrustify updated on a Win10 machine. uncrustify.cfg has been created by the extension.

When trying to format an Apex Class, I get:

Debug: config file: c:\Users\szand\OneDrive\dev\ReleaseVersionReader\uncrustify.cfg
Debug: launched: uncrustify -l JAVA -c c:\Users\szand\OneDrive\dev\ReleaseVersionReader\uncrustify.cfg
Debug: uncrustify exited with error: Parsing: 947 bytes (947 chars) from stdin as language JAVA

For some of my classes it does nothing, for others it reduces identation.

Running locally in powershell against the same file, I see no issues and the file is outputted correctly:

cat .\ReleaseVersionReader.cls | uncrustify -l JAVA -c c:\Users\szand\OneDrive\dev\ReleaseVersionReader\uncrustify.cfg
Parsing: 948 bytes (948 chars) from stdin as language JAVA
public with sharing class ReleaseVersionReader{
// rest of class

I have no clue where I should start looking.

LaurentTreguier commented 6 years ago

While at some point Apex could apparently be formatted as Java (#1), it has never been officially supported (#6). An update in uncrustify probably broke the compatibility...