1
 Follower
7
 Likes

Fancier Assign and Switch Auto-Captions

Service Studio
On our radar

I often go in and make more specific labels for the assignments. It would be nice if there was a base set of standard automatic captions for certain common cases:

  • Assign Variable -> False would give "Not Variable" or "Clear Variable"
  • Assign Variable -> Variable + 1 would give "Increment Variable"
  • Assign Variable -> Variable - 1 would give "Decrement Variable"
  • Assign Variable -> NullIdentifier() would give "Clear Variable"
  • Assign Variable -> "" would give "Blank Variable" (or "Clear Variable", sure)

For the Switch, it would be nice if, given that all conditions were in the same format, to automatically caption the arrow with the rvalue (e.g. Request = "admin" would show as "1 ("admin")" or "1 (admin)" instead of "1 (Request = "admin") )...

...and if the rvalue is a static entity, to caption the arrow with just the deepest identifier name, e.g. Directive.Verb = Entities.Verbs.Explode would show as "1 (Explode)" instead of "1 (Directive.Verb = Entities.Verbs.Explode)" (or whatever it gets cut off to)

If the lvalue is the same, it might also be nice to change the Switch to Switch <lvalue> (e.g. Directive.Verb = ___ for every condition would show "Switch Directive.Verb" or "Switch Verb" instead of "Switch")

I know it's a lot to ask, but it would be cool :)

-- Ritchie

Created on 18 Sep 2018
Comments (6)

Mega like to your idea, Ritchie!

The Switch captions is my most common use-case, but it would be also awesome if, whenever you drag a variable whose type is Record onto the canvas, the generated Assign node got its caption after the variable's name, instead of just "Assign".


Cheers!

Heck yes, Ricardo - maybe determining if the lvalue has a common element, so it could have the caption for the record variable regardless of whether the user dropped it, typed it or split it out from a bigger assign?

So if it saw A.a = something, A.b = something, A.c = something, it would caption it as A, or even more complicated like A.List.Current.a = something, A.List.Current.b = something, etc., would it make sense to caption it A.List.Current?

Cheers as well! :)

Sure, I totally agree with you.

Changed the category to Service Studio


Changed the status to
On our radar


Hey Ritchie,

A lot of little improvements we have here to improve the code readibility!

Thanks for your contribution !

Obrigado, Vasco! :)

views
302
Followers
1