Page 1 of 1
CompilerIf causes problems with IDE struct parsing
Posted: Sun Nov 22, 2015 1:21 am
by Mistrel
Code: Select all
CompilerIf #PB_Processor_x64
Structure SomeStructA Align 4
CompilerElse
Structure SomeStructA
CompilerEndIf
a.i
b.i
c.i
EndStructure
Structure SomeStructB
d.SomeStructA
EndStructure
*This1.SomeStructA
*This2.SomeStructB
*This1\ <- autocomplete is wrong
*This2\ <- autocomplete is wrong
Yes, I can write the structure twice but this is code duplication and causes problems if I make a mistake and they go out of sync. Then if I look at it later I may not remember which is the most recent version.
Re: CompilerIf causes problems with IDE struct parsing
Posted: Sun Nov 22, 2015 1:44 am
by DontTalkToMe
The problem is most things after Structure become a field to the autocomplete, which is confused not finding a simple Structure EndStructure sequence.
Even doing this does not solve the problem
Code: Select all
CompilerIf #PB_Processor_x64
Macro AlignArch
Align 4
EndMacro
CompilerElse
Macro AlignArch
EndMacro
CompilerEndIf
Structure SomeStructA AlignArch
a.i
b.i
c.i
EndStructure
Structure SomeStructB
d.SomeStructA
EndStructure
*This1.SomeStructA
*This2.SomeStructB
Looks like it should be simple to understand, but now AlignArch becomes a field instead.
In the end the same thing reported here
http://www.purebasic.fr/english/viewtop ... =4&t=59911
Even assuming this specific case can be solved in some other way, in general when you start splitting multiline entities into conditional branches, autocomplete gives up.
Re: CompilerIf causes problems with IDE struct parsing
Posted: Fri Jan 29, 2016 2:12 pm
by Fred
The IDE can't resolve the CompilerIf (it's , so you will have to write it differently if you want the IDE to behave correctly.
Re: CompilerIf causes problems with IDE struct parsing
Posted: Sat Jan 30, 2016 9:16 am
by netmaestro
Fred wrote:( it's , so you will have to write it differently..[] )
Sorry, it's... Good? Bad? Tuesday? Raining? Almost time?
Wait, I know! It's in Russian and you can't pronounce it!