Azure / azure-functions-templates

Azure functions templates for the azure portal, CLI, and VS
MIT License
345 stars 197 forks source link

Improve intellisense in JS Functions #941

Open anthonychu opened 4 years ago

anthonychu commented 4 years ago

@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:

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

davidmrdavid commented 4 years ago

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

liliankasem commented 2 years ago

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

ejizba commented 2 years ago

@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?