Find all references not working for anonymous structs in C
Testing out "find all references" support in the 0.25-insiders version, I've found that if I have a typedef'd anonymous struct i.e.:
typedef struct { int foo; } my_type;
then "find all references" from the typedef or any element of the struct fails to find any references (they all appear as "not a reference" in the output). Conversely, if I do "find all references" from an actual reference, then it finds them all APART from the definition.
But if I add a name for the struct it all works fine e.g.:
typedef my_struct struct { int foo; } my_type;
It repros with .c files not .cpp. VS has a similar bug in that uses of "foo" in .c files are marked incorrectly as "Not a Reference", but it finds the defintion -- I think it's the same root bug just with a different symptom due to differences in how the root bug is handled. I've filed bug https://developercommunity.visualstudio.com/content/problem/696662/cc-find-all-references-gives-not-a-reference-for-m.html .
Hit this today (on the way back from CLion).
Refactoring is impacted as well (i.e. rename doesn't rename the usages of anonymous structs/unions.)
I wasn't able to reproduce with a test case so I'm not filing a new bug, but this is probably related:
The reference to emulate on this line: https://github.com/dsalt/devilspie2/blob/760df8ce0db8f51c75acbb27ab0e420174cb8352/src/devilspie2.c#L321 also triggers the "NOT A REFERENCE" behavior when doing "Find All References" on another reference to emulate.
My example and this whole bug may also be related to #4173
The Visual Studio ticket linked to this issue was closed without a fix. Unfortunately, that means a fix will not be coming to VS Code either.