vendor tsgo
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
// Code generated by convertFourslash; DO NOT EDIT.
|
||||
// To modify this test, run "npm run makemanual completionsJsxAttributeInitializer2"
|
||||
|
||||
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 TestCompletionsJsxAttributeInitializer2(t *testing.T) {
|
||||
fourslash.SkipIfFailing(t)
|
||||
t.Parallel()
|
||||
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
||||
const content = `// @Filename: /a.tsx
|
||||
declare namespace JSX {
|
||||
interface IntrinsicElements {
|
||||
div: { a: string, b: string }
|
||||
}
|
||||
}
|
||||
const foo = 0;
|
||||
<div x=[|f/*0*/|] />;
|
||||
|
||||
<div a="1" b/*1*/ />
|
||||
<div a /*2*/ />`
|
||||
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
||||
defer done()
|
||||
f.VerifyCompletions(t, "0", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Includes: []fourslash.CompletionsExpectedItem{
|
||||
&lsproto.CompletionItem{
|
||||
Label: "foo",
|
||||
InsertText: new("{foo}"),
|
||||
Detail: new("const foo: 0"),
|
||||
Kind: new(lsproto.CompletionItemKindVariable),
|
||||
TextEdit: &lsproto.TextEditOrInsertReplaceEdit{
|
||||
TextEdit: &lsproto.TextEdit{
|
||||
NewText: "foo",
|
||||
Range: f.Ranges()[0].LSRange,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, []string{"1", "2"}, &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Exact: []fourslash.CompletionsExpectedItem{
|
||||
"b",
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user