Skip to content

Commit 51d5fe5

Browse files
Copilotjakebailey
andcommitted
Initial analysis and test case for document highlight crash
Co-authored-by: jakebailey <[email protected]>
1 parent c206f00 commit 51d5fe5

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
func TestDocumentHighlightImportPath(t *testing.T) {
11+
t.Parallel()
12+
13+
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
14+
const content = `// @Filename: /a.d.ts
15+
declare module "my-module" {
16+
export const foo: number;
17+
}
18+
19+
// @Filename: /b.ts
20+
import { foo } from "[|my-module|]";`
21+
f := fourslash.NewFourslash(t, nil /*capabilities*/, content)
22+
f.VerifyBaselineDocumentHighlights(t, nil /*preferences*/, f.Ranges()[0])
23+
}

0 commit comments

Comments
 (0)