Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multidimensional arrays #491

Merged
merged 1 commit into from
May 12, 2017

Conversation

rklfss
Copy link
Contributor

@rklfss rklfss commented May 1, 2017

This PR adds the support for multidimensional arrays.

Therefore the isArray flag was removed in favor of a new array type model.

This is necessary because setting the isArray flag of a type that is already an array - which in fact happened for multidimensional arrays - has no effect.

convertNode(context: Context, node: ts.ArrayTypeNode): Type {
        let result = this.owner.convertType(context, node.elementType);

        if (result) { // What if isArray is already true here?
            result.isArray = true;
        } else {
            result = new IntrinsicType('Array');
        }

        return result;
}

Please consider the corresponding PR for themes: TypeStrong/typedoc-default-themes#48

Added an array type model to support multidimensional arrays. Removed
the isArray flag in favor of the type model. Added
supportsType/convertType to array converter to detect the type:reference
arrays.
@blakeembrey
Copy link
Member

This seems like a useful change to me. Does anyone else want to review it?

Should we merge and release the theme changes as a new minor first, then update this PR and release a minor of TypeDoc?

@rklfss
Copy link
Contributor Author

rklfss commented May 12, 2017

Any reactions on this one? I'll be definitely happy to get a second and third opinion.

However you handle the two repositories, both changes are not compatible without each other. So the way you mentioned sounds like a proper way to go.

@blakeembrey blakeembrey merged commit 54e0017 into TypeStrong:master May 12, 2017
@rklfss rklfss deleted the multidimensional-array branch May 14, 2017 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants