Title: Re: default integer type for codetools
Post by: lucamar on November 19, 2020, 02:43:56 pm
I don't think you can. After analizing the line Lazarus always "completes" to the closest, more generic type it can find which in this case is Integer, just as with strings it always completes to generic String rather that using Short- or AnsiString.
Title: Re: default integer type for codetools
Post by: BeniBela on November 22, 2020, 12:03:13 pm
But integer is neither the closest (that would be byte or shortint) nor the most generic (which would be sizeint)
Even if there is no config option, there should be at least a line in the code where it can be patched
Title: Re: default integer type for codetools
Post by: lucamar on November 22, 2020, 01:40:33 pm
But integer is neither the closest (that would be byte or shortint) nor the most generic (which would be sizeint)
Even if there is no config option, there should be at least a line in the code where it can be patched
Maybe "closest" was not the right term; I meant "basest", as in "the more general type". For reals, for example, it completes "i := 0.8" by adding "i: Extended".
But I might be completely wrong. If you want to know exactly what it's doing your best bet is to dive into the sources and, maybe, build a patch to allow it to be configurable.