Skip to content

Support types declared in comments #1030

@TwitchBronBron

Description

@TwitchBronBron

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:

 '@param node roSGNodeLabel
 Function getLabelText(node)
     Return node.propNotOnLabel
                 ~~~~~ unknown prop
 End function

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions