Skip to content

Commit e16624b

Browse files
Copilotjakebailey
andcommitted
Add array binding pattern test case
Co-authored-by: jakebailey <[email protected]>
1 parent 29a1c2f commit e16624b

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package fourslash_test
2+
3+
import (
4+
"testing"
5+
6+
"github.com/microsoft/typescript-go/internal/fourslash"
7+
"github.com/microsoft/typescript-go/internal/testutil"
8+
)
9+
10+
// Regression test for panic: "Unhandled case in Node.Text: *ast.BindingPattern"
11+
// This tests array binding patterns specifically.
12+
func TestFindAllRefsJSDocArrayDestructuredParam(t *testing.T) {
13+
t.Parallel()
14+
15+
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
16+
const content = `
17+
/**
18+
* @param /*1*/arr - array destructured parameter
19+
*/
20+
function f([x, y]) {}
21+
`
22+
f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
23+
f.VerifyBaselineFindAllReferences(t, "1")
24+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// === findAllReferences ===
2+
// === /findAllRefsJSDocArrayDestructuredParam.ts ===
3+
// /**
4+
// * @param /*FIND ALL REFS*/arr - array destructured parameter
5+
// */
6+
// function f([x, y]) {}
7+
//

0 commit comments

Comments
 (0)