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

ClassDeclarationStructure has no support for static block structures #1487

Closed
ajvincent opened this issue Jan 13, 2024 · 0 comments · Fixed by #1520
Closed

ClassDeclarationStructure has no support for static block structures #1487

ajvincent opened this issue Jan 13, 2024 · 0 comments · Fixed by #1520

Comments

@ajvincent
Copy link
Contributor

ajvincent commented Jan 13, 2024

Describe the bug

Version: 21.0.1

I discovered this tonight, realizing we can't actually get any ClassStaticBlockDeclarationStructure objects via ClassDeclarationNode.prototype.getStructure(). This is one of a few structure types unreachable from a sourceFile.getStructure() call.

To Reproduce

class Foo {
    static x: number;
    static {
        this.x = 0;
    }
}

ts-ast-viewer link

Expected behavior

I'd like to call classDeclaration.getStructure() and get any static blocks via a field on the ClassDeclarationStructure.

Note: I don't have a need for this. I'm filing this for completeness.

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 a pull request may close this issue.

1 participant