azure-functions-templates icon indicating copy to clipboard operation
azure-functions-templates copied to clipboard

Improve intellisense in JS Functions

Open anthonychu opened this issue 4 years ago • 3 comments

@btholt @dariagrigoriu After our conversation earlier this week about better typing/intellisense support for JS Functions, experimented with this a bit and it seems to work. We could update the JS templates with the proper JSDoc annotations to get VS Code intellisense to work. Requires these changes:

  • Add JSDoc style comments to all templates.
  • Include @azure/functions by default in package.json created by VS Code and Core Tools.

It uses a weird @param {import('@azure/functions').HttpRequest} req syntax that's a TypeScript thing and is not valid JSDoc. This could be a problem for anyone generating JSDoc for their function app.

Check out this sample repo here: https://github.com/anthonychu/functions-jsdoc-intellisense

anthonychu avatar Apr 16 '20 20:04 anthonychu

This would be great to have! I'm also concerned about the @param {import('@azure/functions').<type>} <param> requirement. I would prefer to have something like @param az_func.HttpRequest req.

I'm unsure if we can do that, but I suspect that if we implicitly load function types under a handy namespace, like az_func, then it should be feasible?

Although if this is something that JS users are used to, when leveraging TS type definitions, then I'm not too concerned. Just my 2 cents

davidmrdavid avatar Apr 16 '20 23:04 davidmrdavid

@fabiocav or @ejizba any idea where the right place is for this issue to be triaged?

liliankasem avatar Dec 13 '21 12:12 liliankasem

@anthonychu do we still want to do this or should we close in favor of https://github.com/Azure/azure-functions-nodejs-worker/issues/480?

ejizba avatar Dec 13 '21 17:12 ejizba