You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
OS: [Windows 10]
VSCode version: 1.84.0
Extension version: v6.2.0
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.
newHandle:g_hFile = INVALID_HANDLE;
which looks good in VS Code, ('Handle' is in green, not blue) becomes
newHandle : g_hFile = INVALID_HANDLE;
Now with an error indicated and 'Handle' coloured in blue.
To Reproduce
Create a sp file in VS Code
Declare a variable with no space before the colon, e.g., new Handle:g_hFile = INVALID_HANDLE;
Use VS Code autoformatter (Shift + Alt + F in Windows)
Observe red line and error
Expected behaviour
I presume there should be no error indicated, and the variable type should still be coloured green
Auto 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.
The text was updated successfully, but these errors were encountered:
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 😜
pabertay
changed the title
Linter(?) recognises spaces around colon as error "(ERROR (symbol))"
Autoformatter adds spaces around colon in variable declaration
Nov 7, 2023
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.
The text was updated successfully, but these errors were encountered: