[squeak-dev] Create new trait in Browser

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Sun Dec 8 17:46:32 UTC 2019


Ah cool, I actually was not aware of that class menu :-)


Yes, adding more templates there via a submenu sounds reasonable to me. +1!

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Jakob Reschke <forums.jakob at resfarm.de>
Gesendet: Sonntag, 8. Dezember 2019 17:46:07
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] Create new trait in Browser

That might be nice. But I think this is too many steps ahead for now.

Today the templates are invoked either
- via empty selection (for a new class deriving from Object), or
- the class menu (to make subclasses of the selected class).
The trait template should be available somewhere similar.

Hooking into the menus is probably much easier than extending the auto-completion. The unsent method addSpecialMenu: looks like it was already done or considered at some point, but then got dropped or was overlooked and forgotten.

Am So., 8. Dez. 2019 um 17:32 Uhr schrieb Thiede, Christoph <Christoph.Thiede at student.hpi.uni-potsdam.de<mailto:Christoph.Thiede at student.hpi.uni-potsdam.de>>:

Nice idea! I have been using Traits for only one time in my Squeak life so far, but they surely can be helpful in certain cases.


Would this maybe be rather a job for a good autocompletion?

If I'm creating code, I will not search in any menus. I would like to type "Trait" into the class definition field and be proposed "Trait named: ___ uses: ___". Same for "Morph" ("Morph subclass: ___ instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'xyz'", and also the version with #uses:).
The autocompletion could detect that you are typing into a class definition field and then first suggest selectors from a whitelist of the ones mentioned above.

This whitelist could be defined by certain message categories (Class: #'subclass creation', Trait: #'instance creation').
I'm not familiar with the OCompletion implementation, but a bit with Autocompletion<https://github.com/MrModder/Autocompletion>, where the latter allows specifying custom completion controllers, so this should be possible without huge design changes. Does someone know about OCompletion?

Best,
Christoph
________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org<mailto:squeak-dev-bounces at lists.squeakfoundation.org>> im Auftrag von Jakob Reschke <forums.jakob at resfarm.de<mailto:forums.jakob at resfarm.de>>
Gesendet: Sonntag, 8. Dezember 2019 16:39:57
An: squeak-dev at lists.squeakfoundation.org<mailto:squeak-dev at lists.squeakfoundation.org>
Betreff: [squeak-dev] Create new trait in Browser

Hello,

When I want to create a new Trait, I currently search and type the trait template myself. You know, Trait named: #foo uses: ...

Should there not be a context menu item that fills the browser code pane with the template?

I see there is Browser>>newTrait and Browser>>addSpecialMenu: but the latter has no senders in my Trunk image.

Kind regards
Jakob

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191208/c2f57957/attachment.html>


More information about the Squeak-dev mailing list