typescript-go icon indicating copy to clipboard operation
typescript-go copied to clipboard

source file binary format is not work

Open quininer opened this issue 1 month ago • 0 comments

Currently the @typescript/ast package provided via source file binary format cannot properly access simple ast.

like

function foo() {
    console.log("hello", "world")
}

This failed for two reasons:

  • when FunctionDeclaration.parameter is empty but not nil, it will occupy a slot but will not generate correspond node.
  • getOrCreateChildAtNodeIndex assume a linear layout, but that's not true.

I provided the test and fix in https://github.com/microsoft/typescript-go/pull/2006, but I reopened an issue to provide discoverability (I don't know if care about external contributions).

quininer avatar Nov 05 '25 06:11 quininer