Open TwitchBronBron opened 8 months ago
I agree that this should be in … but probably for a release after v1.0.0 That being said, Getting the @param tags out of the comment is pretty straightforward - this wouldn’t be very hard to do at all.
The reason I think we might want to consider adding this for the v1 alphas is that it would allow even more dev shops to start testing out the actual type system before the final release which gives us higher confidence in the release.
But yeah, if we are getting to bogged down with other stuff, I agree this could go after v1 lands
Many dev shops are not permitted to use the BrighterScript transpiled, and as such, cannot leverage all the advanced types we've added to v1.
We should support parsing and validating based on types that are declared in comments as well. (Typescript does this with jsdoc). Something like:
The above case is pretty cut and dry. Not sure how we should handle when the param has a basic type like
object
and the doc has a more complex type. Maybe a warning?I think the declared type needs to win over a comment type.
We should use this typescript docs page for reference and inspiration: https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html