[Lazarus] How do I tell codetools to use implicitly loaded unit for code complesion?

Michael Ring mail at michael-ring.org
Tue Oct 21 22:27:39 CEST 2014


Hi Mattias, unfortunately I did not see your answer back in July.

I did some digging myself and found GetHiddenUsedUnits.

The rule to make loading happen is that target os is "embedded" fpc 
version >= 2.7.1 and the value of the option -Wp determines which unit 
to load.

Example: -Wppic32mx795f512h

should load unit pic32mx795f512h

to make life a (very little) harder the fully correct rule for selecting 
the right unit is:

search for uppercase(-WpVALUE) in array embeddedcontrollers (defined in 
[arm,mipsel,avr]/cpuinfo.pas) and load the unit with name defined in the 
field controllerunitstr

Is something like this doable?

I already hardcoded the unit for my testing purposes (Works fine), but 
failed to find a way to get the value of the -Wp switch in 
GetHiddenUsedUnits.


Michael


Am 14.07.14 um 23:34 schrieb Mattias Gaertner:
> On Sat, 05 Jul 2014 17:03:55 +0200
> Michael Ring <mail at michael-ring.org> wrote:
>
>> [...]
>> Is there a way that I can give a hint to codetools to also use this unit
>> for code competion?
>>
>> program hello;
>> uses
>>     pic32mx795f512h;
> Codetools have built in rules to determine the auto used units (see
> TLinkScanner.GetHiddenUsedUnits).
> The pic32mx795f512h needs to be added.
> When is it used?
> What fpc version, target OS, target CPU, options enables this unit?
>
> Mattias
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus





More information about the Lazarus mailing list