vendor tsgo
This commit is contained in:
122
tools/tsgo/internal/fourslash/tests/gen/tsxCompletion13_test.go
Normal file
122
tools/tsgo/internal/fourslash/tests/gen/tsxCompletion13_test.go
Normal file
@@ -0,0 +1,122 @@
|
||||
// Code generated by convertFourslash; DO NOT EDIT.
|
||||
// To modify this test, run "npm run makemanual tsxCompletion13"
|
||||
|
||||
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 TestTsxCompletion13(t *testing.T) {
|
||||
fourslash.SkipIfFailing(t)
|
||||
t.Parallel()
|
||||
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
||||
const content = `//@Filename: file.tsx
|
||||
// @jsx: preserve
|
||||
// @skipLibCheck: true
|
||||
declare namespace JSX {
|
||||
interface Element { }
|
||||
interface IntrinsicElements {
|
||||
}
|
||||
interface ElementAttributesProperty { props; }
|
||||
}
|
||||
interface ClickableProps {
|
||||
children?: string;
|
||||
className?: string;
|
||||
}
|
||||
interface ButtonProps extends ClickableProps {
|
||||
onClick(event?: React.MouseEvent<HTMLButtonElement>): void;
|
||||
}
|
||||
interface LinkProps extends ClickableProps {
|
||||
goTo: string;
|
||||
}
|
||||
declare function MainButton(buttonProps: ButtonProps): JSX.Element;
|
||||
declare function MainButton(linkProps: LinkProps): JSX.Element;
|
||||
declare function MainButton(props: ButtonProps | LinkProps): JSX.Element;
|
||||
let opt = <MainButton /*1*/ />;
|
||||
let opt = <MainButton children="chidlren" /*2*/ />;
|
||||
let opt = <MainButton onClick={()=>{}} /*3*/ />;
|
||||
let opt = <MainButton onClick={()=>{}} ignore-prop /*4*/ />;
|
||||
let opt = <MainButton goTo="goTo" /*5*/ />;
|
||||
let opt = <MainButton wrong /*6*/ />;`
|
||||
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
||||
defer done()
|
||||
f.VerifyCompletions(t, []string{"1", "6"}, &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Exact: []fourslash.CompletionsExpectedItem{
|
||||
"goTo",
|
||||
"onClick",
|
||||
&lsproto.CompletionItem{
|
||||
Label: "children?",
|
||||
InsertText: new("children"),
|
||||
FilterText: new("children"),
|
||||
Kind: new(lsproto.CompletionItemKindField),
|
||||
SortText: new(string(ls.SortTextOptionalMember)),
|
||||
},
|
||||
&lsproto.CompletionItem{
|
||||
Label: "className?",
|
||||
InsertText: new("className"),
|
||||
FilterText: new("className"),
|
||||
Kind: new(lsproto.CompletionItemKindField),
|
||||
SortText: new(string(ls.SortTextOptionalMember)),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, "2", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Exact: []fourslash.CompletionsExpectedItem{
|
||||
"goTo",
|
||||
"onClick",
|
||||
&lsproto.CompletionItem{
|
||||
Label: "className?",
|
||||
InsertText: new("className"),
|
||||
FilterText: new("className"),
|
||||
Kind: new(lsproto.CompletionItemKindField),
|
||||
SortText: new(string(ls.SortTextOptionalMember)),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, []string{"3", "4", "5"}, &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Exact: []fourslash.CompletionsExpectedItem{
|
||||
&lsproto.CompletionItem{
|
||||
Label: "children?",
|
||||
InsertText: new("children"),
|
||||
FilterText: new("children"),
|
||||
Kind: new(lsproto.CompletionItemKindField),
|
||||
SortText: new(string(ls.SortTextOptionalMember)),
|
||||
},
|
||||
&lsproto.CompletionItem{
|
||||
Label: "className?",
|
||||
InsertText: new("className"),
|
||||
FilterText: new("className"),
|
||||
Kind: new(lsproto.CompletionItemKindField),
|
||||
SortText: new(string(ls.SortTextOptionalMember)),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user