vscode-uncrustify icon indicating copy to clipboard operation
vscode-uncrustify copied to clipboard

Extension removes all the code

Open TheAifam5 opened this issue 4 years ago • 5 comments

System

OS: ArchLinux VSCode: 1.45.1 Ext Version: 2.20.1 Uncrustify: Uncrustify-0.71.0-21-d4da2b0f

Last known working version: 2.19.2

Before

image

After (pressing CTRL-S)

image

CLI

uncrustify -c uncrustify.cfg -f include/app.h
Parsing: include/app.h as language C-Header
#ifndef __AE_RENDERER_H__
#define __AE_RENDERER_H__

#endif // __AE_RENDERER_H__

"uncrustify.debug": true - useless, no logging

The issue does not occur when extension is disabled.

TheAifam5 avatar Jun 01 '20 12:06 TheAifam5

Something must have changed in uncrustify-0.71.0 that breaks this. Using "uncrustify.useReplaceOption": true works.

carlolars avatar Jun 01 '20 13:06 carlolars

@carlolars Sadly not for me https://github.com/LaurentTreguier/vscode-uncrustify/issues/64

TheAifam5 avatar Jun 01 '20 13:06 TheAifam5

Okay, with this and the 2 other issues you opened, something is clearly not right. I'll check with Uncrustify 0.71 when I have the time. The fact that you have no logging is extremely strange however.

LaurentTreguier avatar Jun 01 '20 13:06 LaurentTreguier

Logs: uncrustify-0.70.2, working:

Debug: config file: /c/.../uncrustify.cfg
Debug: launched: uncrustify -l C -c /c/.../uncrustify.cfg
Debug: uncrustify exited with status: 0
Debug: uncrustify exited with error: Parsing: 15443 bytes (15443 chars) from stdin as language C

uncrustify-0.71.0:

Debug: config file: /c/.../uncrustify.cfg
Debug: launched: uncrustify -l C -c /c/.../uncrustify.cfg
Debug: uncrustify exited with status: 1
Debug: uncrustify exited with error: Try running with -h for usage information
Parsing: 0 bytes (0 chars) from stdin as language C

carlolars avatar Jun 01 '20 14:06 carlolars

I opened a PR for Uncrustify regarding this issue. Uncrustify 0.71.0 reopens its stdin in binary mode, and NodeJS doesn't like that on Linux it seems; but reopening stdin should only be necessary on Windows.

LaurentTreguier avatar Jun 01 '20 20:06 LaurentTreguier