mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
129 lines
3.9 KiB
Go
129 lines
3.9 KiB
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual completionListStaticProtectedMembers"
|
|
|
|
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 TestCompletionListStaticProtectedMembers(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `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;
|
|
|
|
static test() {
|
|
Base./*1*/;
|
|
this./*2*/;
|
|
C1./*3*/;
|
|
}
|
|
}
|
|
|
|
class C1 extends Base {
|
|
protected static protectedOverriddenMethod() { }
|
|
protected static protectedOverriddenProperty;
|
|
}`
|
|
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
|
defer done()
|
|
f.VerifyCompletions(t, []string{"1", "2"}, &fourslash.CompletionsExpectedList{
|
|
IsIncomplete: false,
|
|
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
|
CommitCharacters: &DefaultCommitCharacters,
|
|
EditRange: Ignored,
|
|
},
|
|
Items: &fourslash.CompletionsExpectedItems{
|
|
Includes: []fourslash.CompletionsExpectedItem{
|
|
&lsproto.CompletionItem{
|
|
Label: "privateMethod",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "privateProperty",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "protectedMethod",
|
|
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: "protectedOverriddenMethod",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "protectedOverriddenProperty",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
},
|
|
},
|
|
})
|
|
f.VerifyCompletions(t, "3", &fourslash.CompletionsExpectedList{
|
|
IsIncomplete: false,
|
|
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
|
CommitCharacters: &DefaultCommitCharacters,
|
|
EditRange: Ignored,
|
|
},
|
|
Items: &fourslash.CompletionsExpectedItems{
|
|
Includes: []fourslash.CompletionsExpectedItem{
|
|
&lsproto.CompletionItem{
|
|
Label: "privateMethod",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "privateProperty",
|
|
SortText: new(string(ls.SortTextLocalDeclarationPriority)),
|
|
},
|
|
&lsproto.CompletionItem{
|
|
Label: "protectedMethod",
|
|
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)),
|
|
},
|
|
},
|
|
Excludes: []string{
|
|
"protectedOverriddenMethod",
|
|
"protectedOverriddenProperty",
|
|
},
|
|
},
|
|
})
|
|
}
|