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
I'm not fluent in C++.
I seemed to remember there was a type called address_t, so before I even googled it I just thought I'd try, and I wrote:
//......
int x = 8;
address_t idx = 0;
//...
As soon as I typed the "t" in "address_t", the supposed type name became highlighted in the same color as other correct types, like int in the line above.
So that made me think that it was correct.
Then I compiled, and it doesn't compile:
Compilation error: 'address_t' does not name a type
So I tried and replaced address_t with lkjsnldf_t and that gets highlighted too.
It's not because of the position either. If I write "lsdfnvlsdnv", it does not get highlighted.
Apparently anything ending in _t gets recognized as a valid type name.
This is Textmate token scope: support.type.built-in.posix-reserved.cpp support.type.posix-reserved.cpp source.cpp
Steps to reproduce:
Have a sketch (The funny thing is even the default cpp syntax coloring marks kvbsv_t as a type 👇):
voidsetup() {}
voidloop() {}
kvbsv_t x = 0;
Execute the Developer: Inspect Token command,
Select kvbsv_t
I got the same behavior from VS Code and the Theia Blueprint applicant. I doubt this is an issue in IDE2 or something we can fix, but I will investigate where the scope comes from VS Code or the no grammar.
Describe the problem
I'm not fluent in C++.
I seemed to remember there was a type called
address_t
, so before I even googled it I just thought I'd try, and I wrote:As soon as I typed the "t" in "address_t", the supposed type name became highlighted in the same color as other correct types, like
int
in the line above.So that made me think that it was correct.
Then I compiled, and it doesn't compile:
So I tried and replaced
address_t
withlkjsnldf_t
and that gets highlighted too.It's not because of the position either. If I write "lsdfnvlsdnv", it does not get highlighted.
Apparently anything ending in
_t
gets recognized as a valid type name.To reproduce
Type:
Expected behavior
kvbsv_t shouldn't get highlighted as a type name.
Arduino IDE version
2.2.1
Operating system
Linux
Operating system version
Manjaro Linux
Additional context
No response
Issue checklist
The text was updated successfully, but these errors were encountered: