Friday finking: IDE 'macro expansions'

dn PythonList at DancesWithMice.info
Thu Mar 16 18:55:38 EDT 2023


It is a long, long, time since I've thrown one of these into the 
maelstrom of our musings.
(have the nightmares receded?)


Do you make use of your IDE's expansionist tendencies, and if-so, which 
ones?


NB this is where vi/emacs enthusiasts start chuckling (polite term for 
'insane cackling'). Hence the question's limitation to IDEs, cf 'editors'!
Also: I'm talking 'PyCharm' because of the story, but others use Codium, 
Sublime Text, etc - which presumably offer equivalent features.


Was helping a friend install PyCharm. Jumped into the Settings. Isn't it 
incredible how many there are?

Idly noted that there are two short-cut or macro-expansion types of 
facilities:
- Postfix Completion, (nothing to do with email or polish notation) and
- Live Templates (again, we're not talking about jinja2)


With both, one types an abbreviated-name and the IDE will expand it into 
appropriate code. For (LiveTemplate) example, typing compli and pressing 
Tab induces PyCharm to add the following to the program[me]:

     [ ! for ! in !drop-down menu! if ! ]

It offers further typo-saving through the drop-down menu which lists a 
bunch of likely (iterable) candidates from amongst previously-written 
code. The action continues after selecting from the menu, by inviting 
completion of the other ("!") placeholders, in-turn.


I haven't made use of such a tool, to-date - OK, yes, I have practised a 
high typing-speed (and accuracy). Puff, puff...

Also, at the time, I'm thinking in 'code', rather than about what tool 
might implement said ideas.


Do you make use of such expansionist-tendencies?

Do you make use of other powerful features within the IDE, or are its 
editor functionalities employed at pretty-much the NotePad level?



Web.Refs:
https://www.jetbrains.com/help/pycharm/settings-postfix-completion.html
https://www.jetbrains.com/help/pycharm/using-live-templates.html#live_templates_types
-- 
Regards,
=dn


More information about the Python-list mailing list