Open pabertay opened 9 months ago
Hi, thanks for reporting this!
This is an error on my end. It means that the parser of the lsp (the backend of the extension) does not like Handle:variable
.
I don't know of a setting that could help fix that in the formatter :/
Only temporary workaround until I fix this would be to use the new syntax, without the colon.
Thanks for the quick response. I just realised that I was wrong fundamentally - this does not compile. I must have been not saving the file before running the compiler... always something simple! So the bug is not 'displaying an error when there is none' - there is rightfully an error indicated (but I'm sure you spotted this).
I appreciate your workaround suggestion, think I will go with that so I don't have to delete spaces manually. The other workaround would be to not use auto formatter of course 😜
Please forgive me as I am just a novice, I sincerely hope this isn't a waste of time due to my ignorance.
Basic informations
Further Information
I get a red line and error indication under variable declarations which have a space before the colon.
The code still compiles without error, but the linter seems to not like it (not sure if I'm using 'linter' correctly here).This is a minor issue because when I use autoformat in VS Code (Shift + Alt + F), the formatter adds a space around the colon in variable declarations. I get distracted by these red lines and have to keep deleting the spaces manually.EDIT: Was wrong, code does not compile with spaces. Linter indicating error is correct, the problem is the auto formatter behaviour
e.g.
which looks good in VS Code, ('Handle' is in green, not blue) becomes
Now with an error indicated and 'Handle' coloured in blue.
To Reproduce
new Handle:g_hFile = INVALID_HANDLE;
Expected behaviour
I presume there should be no error indicated, and the variable type should still be coloured greenAuto formatter should not add spaces here
Error messages
(ERROR (symbol))
Additional
I would like to know if I can make changes to the formatter settings JSON file to prevent spaces around colons in these variable declarations.