dmd icon indicating copy to clipboard operation
dmd copied to clipboard

Mark async functions appropriately

Open vsenko opened this issue 5 years ago • 1 comments

Currently async functions are not emphasized in any way. On the other hand JSDoc by default specifically emphasizes them, discussion on the design is in https://github.com/jsdoc/jsdoc/issues/1188.

It would be really useful to mark async functions somehow.

I use this modified sig-name.hbs:

{{#if virtual}}*{{/if}}{{#with (parentObject)}}{{#if virtual}}*{{/if~}}{{/with~}}
{{#if async}}*(async)* {{/if}}{{#if name}}{{#sig~}}
{{{@depOpen}~}}
{{{@codeOpen}~}}
{{#if @prefix}}{{@prefix}} {{/if~}}
{{@parent~}}
{{@accessSymbol}}{{#if (isEvent)}}"{{{name}}}"{{else}}{{{escape name}}}{{/if~}}
{{#if @methodSign}}{{#if (isEvent)}} {{@methodSign}}{{else}}{{@methodSign}}{{/if}}{{/if~}}
{{{@codeClose}~}}
{{#if @returnSymbol}} {{@returnSymbol}}{{/if~}}
{{#if @returnTypes}} {{>linked-type-list types=@returnTypes delimiter=" \| " }}{{/if~}}
{{#if @suffix}} {{@suffix}}{{/if~}}
{{{@depClose}~}}
{{~/sig}}{{/if~}}
{{#if virtual}}*{{/if}}{{#with (parentObject)}}{{#if virtual}}*{{/if~}}{{/with~}}

vsenko avatar Jun 29 '20 09:06 vsenko

Hi, currently most users document async functions like this which also gives you the opportunity to specify @fulfil and @reject..

However, i tested your partial and it looks good too.. However, implementing it will change everyone's documentation output overnight - including those that use the method mentioned above and don't need it..

So, behind a flag, maybe.. Will have a play..

Btw, feel free to post any more ideas you have - now's a good time.

75lb avatar Aug 29 '24 17:08 75lb