you might know, but freak explained here why this is not working currently: http://www.purebasic.fr/blog/?p=417
but you could trick the IDE if you really need to.
I use macros like this by convention in other languages like C and C++ and it's convenient to keep this consistent when updating code back and forth. It's also convenient to see what macros are available for various types in the Procedures tab in the IDE.
Would it be possible to support my particular use case?
I looked at using the a structure with the Extends keyword but would still rather use macros even with the added code bloat. The added use of structures causes a mess in the debugger by creating variations of the same structure when viewing variables where they should be the same type. It also screws with my convention in the debugger as well.
For example, I use all-caps only for macros so seeing it as a structure is hiding the actual structure it's supposed to be using which makes things harder to read. I have to go back and figure out what is being extended.
That is horrible. But I can see that it does indeed work and may be the least painful way of implementing it with regards to code bloat and not having to maintain duplicate structures.
Now that I've seen it I don't know if I can ever un-see it..
Structure SomeStruct
Field.i
EndStructure
; This is just for IDE support
CompilerIf 0
Structure MACRO_STRUCT Extends SomeStruct
EndStructure
CompilerEndIf
Macro MACRO_STRUCT
SomeStruct
EndMacro
; ...
This way you at least don't have to keep multiple structure definitions in sync.
The thing is that macro expansion simply does not fit into the way the whole AutoComplete feature currently works (see the blog post mentioned above). I see no way to add it so that it really works in all circumstance without doing pretty much an actual compilation of the code. A feature that works only in simple circumstances will look like a buggy feature and cause more frustration than help. So I don't think macro expansion will be possible in AutoComplete any time soon.