Page 1 of 1
[IDE-v542] Wrong Procedure Context Help chosen.
Posted: Sat Mar 05, 2016 6:21 pm
by skywalk
With Modules...
Code: Select all
DeclareModule ContextHelp
CompilerIf 0 ;<-- Does not matter if 0 or 1?
Declare MyProc2(Why Does This Appear In Context Help?)
CompilerElse
Declare MyProc2(x$, y.d = #PI, z$ = "")
CompilerEndIf
EndDeclareModule
Module ContextHelp
Procedure MyProc2(x$, y.d = #PI, z$ = "")
Debug x$
EndProcedure
EndModule
ContextHelp::MyProc2("Context Help is wrong!")
Without Modules...
Code: Select all
CompilerIf 0
Declare MyProc(x$, y.d = #PI, z$ = "")
CompilerElse
Declare MyProc(This Should Appear In Context Help?)
CompilerEndIf
Procedure MyProc(x$, y.d = #PI, z$ = "")
Debug x$
EndProcedure
MyProc("Context Help is wrong!") ;<-- Syntax error, but Context Help is wrong!?
Re: [IDE-v542] Wrong Procedure Context Help chosen.
Posted: Sat Mar 05, 2016 9:31 pm
by Demivec
Here's a quote from Fred:
The IDE can't resolve the CompilerIf (it's [sic]

, so you will have to write it differently if you want the IDE to behave correctly.
Re: [IDE-v542] Wrong Procedure Context Help chosen.
Posted: Sun Mar 06, 2016 10:30 pm
by skywalk
Yes, I remember that for syntax highlighting and folding, but this is a bit deeper where the IDE is reading a procedure or prototype definition and should respect the CompilerIf's. If this is not true, it should be mentioned in the Help manual.
Re: [IDE-v542] Wrong Procedure Context Help chosen.
Posted: Mon Mar 07, 2016 2:28 am
by Demivec
skywalk wrote:Yes, I remember that for syntax highlighting and folding, but this is a bit deeper where the IDE is reading a procedure or prototype definition and should respect the CompilerIf's. If this is not true, it should be mentioned in the Help manual.
Since CompilerIf's can't be evaluated there isn't a perfect solution to multiple prototypes being present. Either it's the first definition, the last definition, or no definition that would be the one chosen. Which would be your preference?
jaPBe dealt with this problem by using whichever prototype was last entered (technicality, the one that last had the cursor placed on it's line). Which meant if you cursor'ed through the lines the auto-complete would change depending on the line you last visited. Similar problem, different solution. It is pretty hard to out-think clever programmers.
The method used could be mentioned in the Help manual, though I think you would probably only look there after you first encountered a problem. The next question is where it would be placed.
Re: [IDE-v542] Wrong Procedure Context Help chosen.
Posted: Tue Mar 08, 2016 12:17 am
by freak
The IDE does lexical analysis, not compilation. Such constructs can only be resolved with 100% certainty by doing a full compilation.
Not a bug.
Re: [IDE-v542] Wrong Procedure Context Help chosen.
Posted: Tue Mar 08, 2016 3:01 am
by skywalk
Ok, not a bug, but certainly not expected behavior.
Can this be noted in Help under Context Help?
I would prefer sourcing from a compiled list of known definitions.
The compiler is so fast, it merely needs a few seconds to make this accurate.
Re: [IDE-v542] Wrong Procedure Context Help chosen.
Posted: Mon Jul 25, 2016 7:51 pm
by Tenaja
skywalk wrote:Ok, not a bug, but certainly not expected behavior.
Can this be noted in Help under Context Help?
I would prefer sourcing from a compiled list of known definitions.
The compiler is so fast, it merely needs a few seconds to make this accurate.
So you wouldn't mind waiting a few seconds for each keystroke? Because that is basically what you are asking for.
Re: [IDE-v542] Wrong Procedure Context Help chosen.
Posted: Mon Jul 25, 2016 8:23 pm
by skywalk
How so? This would only occur for CompilerIf's. Remember, the ide is already busy with every keystroke and linefeed and it is not seconds.