mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
203 lines
6.2 KiB
Go
203 lines
6.2 KiB
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual completionListStaticProtectedMembers2"
|
|
|
|
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 TestCompletionListStaticProtectedMembers2(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `// @target: es2015
|
|
// @lib: es5
|
|
class Base {
|
|
private static privateMethod() { }
|
|
private static privateProperty;
|
|
|
|
protected static protectedMethod() { }
|
|
protected static protectedProperty;
|
|
|
|
public static publicMethod() { }
|
|
public static publicProperty;
|
|
|
|
protected static protectedOverriddenMethod() { }
|
|
protected static protectedOverriddenProperty;
|
|
}
|
|
|
|
class C2 extends Base {
|
|
protected static protectedOverriddenMethod() { }
|
|
protected static protectedOverriddenProperty;
|
|
|
|
static test() {
|
|
Base./*1*/;
|
|
C2./*2*/;
|
|
this./*3*/;
|
|
super./*4*/;
|
|
}
|
|
}`
|
|
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
|
defer done()
|
|
f.VerifyCompletions(t, []string{"1"}, &fourslash.CompletionsExpectedList{
|
|
IsIncomplete: false,
|
|
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
|
CommitCharacters: &DefaultCommitCharacters,
|
|
EditRange: Ignored,
|
|
},
|
|
Items: &fourslash.CompletionsExpectedItems{
|
|
Exact: CompletionFunctionMembersPlus(
|
|
[]fourslash.CompletionsExpectedItem{
|
|
&lsproto.CompletionItem{
|
|
Label: "protectedMethod",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "protectedOverriddenMethod",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "protectedOverriddenProperty",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "protectedProperty",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "publicMethod",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "publicProperty",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "prototype",
|
|
SortText: new(string(ls.SortTextLocationPriority)),
|
|
},
|
|
},
|
|
),
|
|
},
|
|
})
|
|
f.VerifyCompletions(t, []string{"2", "3"}, &fourslash.CompletionsExpectedList{
|
|
IsIncomplete: false,
|
|
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
|
CommitCharacters: &DefaultCommitCharacters,
|
|
EditRange: Ignored,
|
|
},
|
|
Items: &fourslash.CompletionsExpectedItems{
|
|
Exact: CompletionFunctionMembersPlus(
|
|
[]fourslash.CompletionsExpectedItem{
|
|
&lsproto.CompletionItem{
|
|
Label: "protectedMethod",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "protectedOverriddenMethod",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "protectedOverriddenProperty",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "protectedProperty",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "publicMethod",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "publicProperty",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "test",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "prototype",
|
|
SortText: new(string(ls.SortTextLocationPriority)),
|
|
},
|
|
},
|
|
),
|
|
},
|
|
})
|
|
f.VerifyCompletions(t, "4", &fourslash.CompletionsExpectedList{
|
|
IsIncomplete: false,
|
|
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
|
CommitCharacters: &DefaultCommitCharacters,
|
|
EditRange: Ignored,
|
|
},
|
|
Items: &fourslash.CompletionsExpectedItems{
|
|
Exact: []fourslash.CompletionsExpectedItem{
|
|
&lsproto.CompletionItem{
|
|
Label: "protectedMethod",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "protectedOverriddenMethod",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "protectedOverriddenProperty",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "protectedProperty",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "publicMethod",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "publicProperty",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "apply",
|
|
SortText: new(string(ls.SortTextLocationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "arguments",
|
|
SortText: new(string(ls.SortTextLocationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "bind",
|
|
SortText: new(string(ls.SortTextLocationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "call",
|
|
SortText: new(string(ls.SortTextLocationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "caller",
|
|
SortText: new(string(ls.SortTextLocationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "length",
|
|
SortText: new(string(ls.SortTextLocationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "prototype",
|
|
SortText: new(string(ls.SortTextLocationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "toString",
|
|
SortText: new(string(ls.SortTextLocationPriority)),
|
|
},
|
|
},
|
|
},
|
|
})
|
|
}
|