mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
92 lines
2.5 KiB
Go
92 lines
2.5 KiB
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual completionListInNamedClassExpressionWithShadowing"
|
|
|
|
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/lsp/lsproto"
|
|
"github.com/microsoft/typescript-go/internal/testutil"
|
|
)
|
|
|
|
func TestCompletionListInNamedClassExpressionWithShadowing(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `class myClass { /*0*/ }
|
|
/*1*/
|
|
var x = class myClass {
|
|
getClassName (){
|
|
m/*2*/
|
|
}
|
|
/*3*/
|
|
}
|
|
var y = class {
|
|
getSomeName() {
|
|
/*4*/
|
|
}
|
|
/*5*/
|
|
}`
|
|
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
|
defer done()
|
|
f.VerifyCompletions(t, "0", &fourslash.CompletionsExpectedList{
|
|
IsIncomplete: false,
|
|
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
|
CommitCharacters: &[]string{},
|
|
EditRange: Ignored,
|
|
},
|
|
Items: &fourslash.CompletionsExpectedItems{
|
|
Excludes: []string{
|
|
"myClass",
|
|
},
|
|
},
|
|
})
|
|
f.VerifyCompletions(t, []string{"1", "4"}, &fourslash.CompletionsExpectedList{
|
|
IsIncomplete: false,
|
|
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
|
CommitCharacters: &DefaultCommitCharacters,
|
|
EditRange: Ignored,
|
|
},
|
|
Items: &fourslash.CompletionsExpectedItems{
|
|
Includes: []fourslash.CompletionsExpectedItem{
|
|
&lsproto.CompletionItem{
|
|
Label: "myClass",
|
|
Detail: new("class myClass"),
|
|
Kind: new(lsproto.CompletionItemKindClass),
|
|
},
|
|
},
|
|
},
|
|
})
|
|
f.VerifyCompletions(t, "2", &fourslash.CompletionsExpectedList{
|
|
IsIncomplete: false,
|
|
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
|
CommitCharacters: &DefaultCommitCharacters,
|
|
EditRange: Ignored,
|
|
},
|
|
Items: &fourslash.CompletionsExpectedItems{
|
|
Includes: []fourslash.CompletionsExpectedItem{
|
|
&lsproto.CompletionItem{
|
|
Label: "myClass",
|
|
Detail: new("(local class) myClass"),
|
|
Kind: new(lsproto.CompletionItemKindProperty),
|
|
},
|
|
},
|
|
},
|
|
})
|
|
f.VerifyCompletions(t, []string{"3", "5"}, &fourslash.CompletionsExpectedList{
|
|
IsIncomplete: false,
|
|
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
|
CommitCharacters: &[]string{},
|
|
EditRange: Ignored,
|
|
},
|
|
Items: &fourslash.CompletionsExpectedItems{
|
|
Excludes: []string{
|
|
"myClass",
|
|
},
|
|
},
|
|
})
|
|
}
|