[Cuis-dev] How to stop the editor asking to delete a certain variable ?

Hernan Wilkinson hernan.wilkinson at 10pines.com
Tue Feb 8 07:24:35 PST 2022


Currently there is no way to configure that behavior.
The method that as for that is Parser>>#selectRemovableUnusedTempsFrom:

A quick trick you could do is to define the method #compilerClass in the
class you want that behavior to change (for example OSProcess). That new
compiler should subclass Compiler and redefine #parserClass with a subclass
of Parser that redefines #selectRemovableUnusedTempsFrom: to do nothing...
maybe it is not that quick but it will do it :-)

We can discuss if we want this behavior to be configurable and therefore
have a preference for that... we try to avoid preferences as much as
possible because they become difficult to remember, but maybe this is a
good place for a preference and if so, for all the others questions the
parser does (uninitialize variable, etc). If we make this configurable, it
would have a global impact (all the classes). We would do it per class
basis, but I'm not sure if it makes sense... anyway, what do you people
think? Does it make sense to make this configurable? Besides Nicola, is
there any other "user" for this?

BTW, I like Luciano's idea of use syntax highlighting for that...


On Tue, Feb 8, 2022 at 1:57 AM Luciano Notarfrancesco via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

> Hi Nicola,
> I think if I wanted to use it as a template I’d put it in a comment.
> I also find that dialog annoying, specially when there are more than one
> unused variable and I have to chase se real dialogs that start appearing at
> different places on the screen for each unused variable. But I like that
> the unused variables are removed. If it were up to me, I’d remove the
> unused variables automatically without asking the user. I think a better
> solution would be to use the syntax highlighter and paint the unused
> variables a different color (say, red) so that the user can see them and
> decide what to do about them, with no dialogs interrupting the user.
>
>
> On Tue, 8 Feb 2022 at 5:18 AM Nicola Mingotti via Cuis-dev <
> cuis-dev at lists.cuis.st> wrote:
>
>> Hi guys,
>>
>> I have this little problem that bugs me. It happens sometimes i want to
>> leave some variables defined in a method, even if i don't use them,
>> because i consider them useful
>> for several reason, maybe just to keep a default call template.
>>
>> Think OSProcess, i want to copy around always the same call template, with
>> 'in', 'out', and 'err'. Even if I don't use some of them.
>>
>> The editor sees i don't really use some of those variable and it complains
>> systematically.
>>
>> Is there a way, also a trick, to make the editor stop complaining ?
>>
>>
>> bye
>>
>> Nicola
>>
>>
>>
>>
>>
>>
>>
>> --
>> Cuis-dev mailing list
>> Cuis-dev at lists.cuis.st
>> https://lists.cuis.st/mailman/listinfo/cuis-dev
>>
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>


-- 
<https://10pines.com/>Hernán WilkinsonSoftware Developer & Coach

Alem 896, Floor 6, Buenos Aires, Argentina

+54 11 6091 3125

@HernanWilkinson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20220208/d7d0571d/attachment.htm>


More information about the Cuis-dev mailing list