97 lines
2.6 KiB
Go
97 lines
2.6 KiB
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual multiModuleClodule"
|
|
|
|
package fourslash_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/microsoft/typescript-go/internal/fourslash"
|
|
. "github.com/microsoft/typescript-go/internal/fourslash/tests/util"
|
|
"github.com/microsoft/typescript-go/internal/ls"
|
|
"github.com/microsoft/typescript-go/internal/lsp/lsproto"
|
|
"github.com/microsoft/typescript-go/internal/testutil"
|
|
)
|
|
|
|
func TestMultiModuleClodule(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `// @lib: es5
|
|
class C {
|
|
constructor(x: number) { }
|
|
foo() { }
|
|
bar() { }
|
|
static boo() { }
|
|
}
|
|
|
|
namespace C {
|
|
export var x = 1;
|
|
var y = 2;
|
|
}
|
|
namespace C {
|
|
export function foo() { }
|
|
function baz() { return ''; }
|
|
}
|
|
|
|
var c = new C/*1*/(C./*2*/x);
|
|
c./*3*/foo = C./*4*/foo;`
|
|
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
|
defer done()
|
|
f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{
|
|
IsIncomplete: false,
|
|
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
|
CommitCharacters: &DefaultCommitCharacters,
|
|
EditRange: Ignored,
|
|
},
|
|
Items: &fourslash.CompletionsExpectedItems{
|
|
Includes: []fourslash.CompletionsExpectedItem{
|
|
"C",
|
|
},
|
|
},
|
|
})
|
|
f.VerifyCompletions(t, []string{"2", "4"}, &fourslash.CompletionsExpectedList{
|
|
IsIncomplete: false,
|
|
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
|
CommitCharacters: &DefaultCommitCharacters,
|
|
EditRange: Ignored,
|
|
},
|
|
Items: &fourslash.CompletionsExpectedItems{
|
|
Exact: CompletionFunctionMembersPlus(
|
|
[]fourslash.CompletionsExpectedItem{
|
|
&lsproto.CompletionItem{
|
|
Label: "boo",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "foo",
|
|
SortText: new(string(ls.SortTextLocationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "prototype",
|
|
SortText: new(string(ls.SortTextLocationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "x",
|
|
SortText: new(string(ls.SortTextLocationPriority)),
|
|
},
|
|
},
|
|
),
|
|
},
|
|
})
|
|
f.VerifyCompletions(t, "3", &fourslash.CompletionsExpectedList{
|
|
IsIncomplete: false,
|
|
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
|
CommitCharacters: &DefaultCommitCharacters,
|
|
EditRange: Ignored,
|
|
},
|
|
Items: &fourslash.CompletionsExpectedItems{
|
|
Exact: []fourslash.CompletionsExpectedItem{
|
|
"bar",
|
|
"foo",
|
|
},
|
|
},
|
|
})
|
|
f.VerifyNoErrors(t)
|
|
}
|