problem-solving icon indicating copy to clipboard operation
problem-solving copied to clipboard

Allow declarator docs on phasers?

Open rcmlz opened this issue 1 year ago • 4 comments

Reading the discussion about RakuDoc and decorators in the advent calendar 2023, I am wondering if there could be an option to get decorators attached to e.g. PRE and POST phasers of methods or subs - in a similar way the leading and tailing decorators can be fetched from methods/subs.

I am thinking towards the way that the special sub MAIN is handled (very conveniently from a users perspective) … to e.g. enable auto generated ToolTips for instance in Jupyter, or autogenerated documentation, which might be a USP for Raku, especially in educational environments.

IF there is added value in attaching somewhat standardized documentation to objects/methods/subs etc. (e.g. Editor support) THEN people consider making this extra effort.

Same as for MAIN - I assume you see a lot of developers using the convenience features for specifying the signature, because it gives an immediate added value to the developer.

So if this magic would not just happen for MAIN but for all ordinary objects/subs/methods/Phasers etc., then ….

rcmlz avatar Dec 09 '23 10:12 rcmlz

OOC, why would this be applied to PRE and POST phasers only? Why not to KEEP and UNDO as well?

FWIW, I don't see a use case for the other phasers, but I could be missing something :-)

lizmat avatar Dec 09 '23 11:12 lizmat

Aggree, there seems to be no reason why to limit decorators only to PRE and POST.

rcmlz avatar Dec 11 '23 13:12 rcmlz

Hi @rcmlz

I'd like to suggest you consider further fleshing out some things related to this issue you've started. I've written a gist about that.

raiph avatar Dec 11 '23 16:12 raiph

I added a few thoughts and some illustrative code to the gist. My base-line is: as long as Raku has no or only basic support in editors/IDE's, it might be more important to focus on syntax highlighting, auto completion and exploiting the already existing features/concepts of Raku. Putting in another feature into Raku that does not easily reach the target audience, is at best questionable.

rcmlz avatar Dec 12 '23 09:12 rcmlz