vendor tsgo
This commit is contained in:
@@ -0,0 +1,285 @@
|
||||
// Code generated by convertFourslash; DO NOT EDIT.
|
||||
// To modify this test, run "npm run makemanual jsxAttributeSnippetCompletionUnclosed"
|
||||
|
||||
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 TestJsxAttributeSnippetCompletionUnclosed(t *testing.T) {
|
||||
fourslash.SkipIfFailing(t)
|
||||
t.Parallel()
|
||||
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
||||
const content = `// @strict: false
|
||||
//@Filename: file.tsx
|
||||
interface NestedInterface {
|
||||
Foo: NestedInterface;
|
||||
(props: {className?: string}): any;
|
||||
}
|
||||
|
||||
declare const Foo: NestedInterface;
|
||||
|
||||
function fn1() {
|
||||
return <Foo>
|
||||
<Foo /*1*/
|
||||
</Foo>
|
||||
}
|
||||
function fn2() {
|
||||
return <Foo>
|
||||
<Foo.Foo /*2*/
|
||||
</Foo>
|
||||
}
|
||||
function fn3() {
|
||||
return <Foo>
|
||||
<Foo.Foo cla/*3*/
|
||||
</Foo>
|
||||
}
|
||||
function fn4() {
|
||||
return <Foo>
|
||||
<Foo.Foo cla/*4*/ something
|
||||
</Foo>
|
||||
}
|
||||
function fn5() {
|
||||
return <Foo>
|
||||
<Foo.Foo something /*5*/
|
||||
</Foo>
|
||||
}
|
||||
function fn6() {
|
||||
return <Foo>
|
||||
<Foo.Foo something cla/*6*/
|
||||
</Foo>
|
||||
}
|
||||
function fn7() {
|
||||
return <Foo /*7*/
|
||||
}
|
||||
function fn8() {
|
||||
return <Foo cla/*8*/
|
||||
}
|
||||
function fn9() {
|
||||
return <Foo cla/*9*/ something
|
||||
}
|
||||
function fn10() {
|
||||
return <Foo something /*10*/
|
||||
}
|
||||
function fn11() {
|
||||
return <Foo something cla/*11*/
|
||||
}`
|
||||
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
||||
defer done()
|
||||
f.VerifyCompletions(t, "1", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Includes: []fourslash.CompletionsExpectedItem{
|
||||
&lsproto.CompletionItem{
|
||||
Label: "className?",
|
||||
InsertText: new("className={$1}"),
|
||||
FilterText: new("className"),
|
||||
Detail: new("(property) className?: string"),
|
||||
InsertTextFormat: new(lsproto.InsertTextFormatSnippet),
|
||||
SortText: new(string(ls.SortTextOptionalMember)),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, "2", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Includes: []fourslash.CompletionsExpectedItem{
|
||||
&lsproto.CompletionItem{
|
||||
Label: "className?",
|
||||
InsertText: new("className={$1}"),
|
||||
FilterText: new("className"),
|
||||
Detail: new("(property) className?: string"),
|
||||
InsertTextFormat: new(lsproto.InsertTextFormatSnippet),
|
||||
SortText: new(string(ls.SortTextOptionalMember)),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, "3", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Includes: []fourslash.CompletionsExpectedItem{
|
||||
&lsproto.CompletionItem{
|
||||
Label: "className?",
|
||||
InsertText: new("className={$1}"),
|
||||
FilterText: new("className"),
|
||||
Detail: new("(property) className?: string"),
|
||||
InsertTextFormat: new(lsproto.InsertTextFormatSnippet),
|
||||
SortText: new(string(ls.SortTextOptionalMember)),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, "4", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Includes: []fourslash.CompletionsExpectedItem{
|
||||
&lsproto.CompletionItem{
|
||||
Label: "className?",
|
||||
InsertText: new("className={$1}"),
|
||||
FilterText: new("className"),
|
||||
Detail: new("(property) className?: string"),
|
||||
InsertTextFormat: new(lsproto.InsertTextFormatSnippet),
|
||||
SortText: new(string(ls.SortTextOptionalMember)),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, "5", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Includes: []fourslash.CompletionsExpectedItem{
|
||||
&lsproto.CompletionItem{
|
||||
Label: "className?",
|
||||
InsertText: new("className={$1}"),
|
||||
FilterText: new("className"),
|
||||
Detail: new("(property) className?: string"),
|
||||
InsertTextFormat: new(lsproto.InsertTextFormatSnippet),
|
||||
SortText: new(string(ls.SortTextOptionalMember)),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, "6", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Includes: []fourslash.CompletionsExpectedItem{
|
||||
&lsproto.CompletionItem{
|
||||
Label: "className?",
|
||||
InsertText: new("className={$1}"),
|
||||
FilterText: new("className"),
|
||||
Detail: new("(property) className?: string"),
|
||||
InsertTextFormat: new(lsproto.InsertTextFormatSnippet),
|
||||
SortText: new(string(ls.SortTextOptionalMember)),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, "7", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Includes: []fourslash.CompletionsExpectedItem{
|
||||
&lsproto.CompletionItem{
|
||||
Label: "className?",
|
||||
InsertText: new("className={$1}"),
|
||||
FilterText: new("className"),
|
||||
Detail: new("(property) className?: string"),
|
||||
InsertTextFormat: new(lsproto.InsertTextFormatSnippet),
|
||||
SortText: new(string(ls.SortTextOptionalMember)),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, "8", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Includes: []fourslash.CompletionsExpectedItem{
|
||||
&lsproto.CompletionItem{
|
||||
Label: "className?",
|
||||
InsertText: new("className={$1}"),
|
||||
FilterText: new("className"),
|
||||
Detail: new("(property) className?: string"),
|
||||
InsertTextFormat: new(lsproto.InsertTextFormatSnippet),
|
||||
SortText: new(string(ls.SortTextOptionalMember)),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, "9", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Includes: []fourslash.CompletionsExpectedItem{
|
||||
&lsproto.CompletionItem{
|
||||
Label: "className?",
|
||||
InsertText: new("className={$1}"),
|
||||
FilterText: new("className"),
|
||||
Detail: new("(property) className?: string"),
|
||||
InsertTextFormat: new(lsproto.InsertTextFormatSnippet),
|
||||
SortText: new(string(ls.SortTextOptionalMember)),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, "10", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Includes: []fourslash.CompletionsExpectedItem{
|
||||
&lsproto.CompletionItem{
|
||||
Label: "className?",
|
||||
InsertText: new("className={$1}"),
|
||||
FilterText: new("className"),
|
||||
Detail: new("(property) className?: string"),
|
||||
InsertTextFormat: new(lsproto.InsertTextFormatSnippet),
|
||||
SortText: new(string(ls.SortTextOptionalMember)),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, "11", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Includes: []fourslash.CompletionsExpectedItem{
|
||||
&lsproto.CompletionItem{
|
||||
Label: "className?",
|
||||
InsertText: new("className={$1}"),
|
||||
FilterText: new("className"),
|
||||
Detail: new("(property) className?: string"),
|
||||
InsertTextFormat: new(lsproto.InsertTextFormatSnippet),
|
||||
SortText: new(string(ls.SortTextOptionalMember)),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user