CompilerIf causes problems with IDE struct parsing

Working on new editor enhancements?
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

CompilerIf causes problems with IDE struct parsing

Post 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.
DontTalkToMe
Enthusiast
Enthusiast
Posts: 334
Joined: Mon Feb 04, 2013 5:28 pm

Re: CompilerIf causes problems with IDE struct parsing

Post 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.
Fred
Administrator
Administrator
Posts: 16619
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: CompilerIf causes problems with IDE struct parsing

Post 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.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8425
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: CompilerIf causes problems with IDE struct parsing

Post 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! :D
BERESHEIT
Post Reply