azure-functions-templates
azure-functions-templates copied to clipboard
Improve intellisense in JS Functions
@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
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
@fabiocav or @ejizba any idea where the right place is for this issue to be triaged?
@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?