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

Michael Ring mail at michael-ring.org
Wed Oct 22 09:51:34 CEST 2014


Thank you for the hint on macros, I will see if I can come up with a patch.

The lookup of the controllerunitstr looks like the 'right' solution, for 
my purposes it would be enough to simply add the value of -Wp, but this 
would only help for mipsel target, for arm there usually exists a 
mapping from the controller model to a more generalized unit.

How do you import definitions like those, do you duplicate the code from 
fpc or do you use the units provided by fpc?

If you duplicate the code it is perhaps better to also make the unit 
files match the controller names in fpc so that the list of controllers 
does not need to get implemented in both fpc and lazarus.

Michael

Am 21.10.14 um 23:28 schrieb Mattias Gaertner:
>
>> Michael Ring <mail at michael-ring.org> hat am 21. Oktober 2014 um 22:27
>> geschrieben:
>> [...]
>> Example: -Wppic32mx795f512h
>>
>> should load unit pic32mx795f512h
> The IDE already does that.
> Search for MacroControllerUnit.
>
>> 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?
> Theoretically yes. Is that needed?
>
>
>> 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.
> 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