ts-morph
ts-morph copied to clipboard
ClassDeclarationStructure has no support for static block structures
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;
}
}
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.