File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 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 TestCodeLensOverloads01 (t * testing.T ) {
12+ t .Parallel ()
13+ defer testutil .RecoverAndFail (t , "Panic on fourslash test" )
14+
15+ const content = `
16+ export function foo(x: number): number;
17+ export function foo(x: string): string;
18+ export function foo(x: string | number): string | number {
19+ return x;
20+ }
21+
22+ foo(1);
23+
24+ foo("hello");
25+
26+ // This one isn't expected to match any overload,
27+ // but is really just here to test how it affects how code lens.
28+ foo(Math.random() ? 1 : "hello");
29+ `
30+ f := fourslash .NewFourslash (t , nil /*capabilities*/ , content )
31+ f .VerifyBaselineCodeLens (t , & lsutil.UserPreferences {
32+ ReferencesCodeLensEnabled : true ,
33+ ReferencesCodeLensShowOnAllFunctions : true ,
34+
35+ ImplementationsCodeLensEnabled : true ,
36+ ImplementationsCodeLensShowOnInterfaceMethods : true ,
37+ ImplementationsCodeLensShowOnAllClassMethods : true ,
38+ })
39+ }
You can’t perform that action at this time.
0 commit comments