Skip to content
This repository was archived by the owner on Sep 1, 2026. It is now read-only.

Commit be911e2

Browse files
CopilotDanielRosenwasserRyanCavanaugh
authored
Add regression test for inlay hints crash on reparsed nodes (#2460) (#2908)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com> Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com> Co-authored-by: Ryan Cavanaugh <RyanCavanaugh@users.noreply.github.com>
1 parent 6d54602 commit be911e2

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package fourslash_test
2+
3+
import (
4+
"testing"
5+
6+
"github.com/microsoft/typescript-go/internal/core"
7+
"github.com/microsoft/typescript-go/internal/fourslash"
8+
"github.com/microsoft/typescript-go/internal/ls/lsutil"
9+
"github.com/microsoft/typescript-go/internal/testutil"
10+
)
11+
12+
func TestInlayHintsReparsedNodeCrash(t *testing.T) {
13+
t.Parallel()
14+
15+
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
16+
const content = `
17+
// @allowJs: true
18+
// @checkJs: true
19+
20+
// @Filename: /a.js
21+
module.exports = function () {
22+
return 1;
23+
};
24+
`
25+
26+
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
27+
defer done()
28+
f.VerifyBaselineInlayHints(t, nil /*span*/, &lsutil.UserPreferences{InlayHints: lsutil.InlayHintsPreferences{
29+
IncludeInlayFunctionLikeReturnTypeHints: core.TSTrue,
30+
IncludeInlayFunctionParameterTypeHints: core.TSTrue,
31+
}})
32+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// === Inlay Hints ===
2+
=== No inlay hints ===

0 commit comments

Comments
 (0)