Skip to content

Commit e1aa16c

Browse files
Copilotjakebailey
andcommitted
Add fourslash test for code lens references including imports
Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
1 parent 3c5ce8b commit e1aa16c

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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/ls/lsutil"
8+
"github.com/microsoft/typescript-go/internal/testutil"
9+
)
10+
11+
func TestCodeLensReferencesIncludeImports(t *testing.T) {
12+
t.Parallel()
13+
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
14+
15+
const content = `
16+
// @Filename: /abc.ts
17+
export function abc() { }
18+
19+
// @Filename: /other.ts
20+
import { abc } from "./abc";
21+
`
22+
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
23+
defer done()
24+
f.VerifyBaselineCodeLens(t, &lsutil.UserPreferences{
25+
CodeLens: lsutil.CodeLensUserPreferences{
26+
ReferencesCodeLensEnabled: true,
27+
ReferencesCodeLensShowOnAllFunctions: true,
28+
},
29+
})
30+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// === Code Lenses ===
2+
// === /abc.ts ===
3+
// export function /*CODELENS: 0 references*/abc() { }
4+
//

0 commit comments

Comments
 (0)