vendor tsgo
This commit is contained in:
@@ -0,0 +1,244 @@
|
||||
// Code generated by convertFourslash; DO NOT EDIT.
|
||||
// To modify this test, run "npm run makemanual completionsStringsWithTriggerCharacter"
|
||||
|
||||
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 TestCompletionsStringsWithTriggerCharacter(t *testing.T) {
|
||||
fourslash.SkipIfFailing(t)
|
||||
t.Parallel()
|
||||
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
||||
const content = `type A = "a/b" | "b/a";
|
||||
const a: A = "[|a/*1*/|]";
|
||||
|
||||
type B = "a@b" | "b@a";
|
||||
const a: B = "[|a@/*2*/|]";
|
||||
|
||||
type C = "a.b" | "b.a";
|
||||
const c: C = "[|a./*3*/|]";
|
||||
|
||||
type D = "a'b" | "b'a";
|
||||
const d: D = "[|a'/*4*/|]";
|
||||
|
||||
type E = "a` + "`" + `b" | "b` + "`" + `a";
|
||||
const e: E = "[|a` + "`" + `/*5*/|]";
|
||||
|
||||
type F = 'a"b' | 'b"a';
|
||||
const f: F = '[|a"/*6*/|]';
|
||||
|
||||
type G = "a<b" | "b<a";
|
||||
const g: G = '[|a</*7*/|]';`
|
||||
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{
|
||||
Exact: []fourslash.CompletionsExpectedItem{
|
||||
&lsproto.CompletionItem{
|
||||
Label: "a/b",
|
||||
TextEdit: &lsproto.TextEditOrInsertReplaceEdit{
|
||||
TextEdit: &lsproto.TextEdit{
|
||||
NewText: "a/b",
|
||||
Range: f.Ranges()[0].LSRange,
|
||||
},
|
||||
},
|
||||
},
|
||||
&lsproto.CompletionItem{
|
||||
Label: "b/a",
|
||||
TextEdit: &lsproto.TextEditOrInsertReplaceEdit{
|
||||
TextEdit: &lsproto.TextEdit{
|
||||
NewText: "b/a",
|
||||
Range: f.Ranges()[0].LSRange,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, "2", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Exact: []fourslash.CompletionsExpectedItem{
|
||||
&lsproto.CompletionItem{
|
||||
Label: "a@b",
|
||||
TextEdit: &lsproto.TextEditOrInsertReplaceEdit{
|
||||
TextEdit: &lsproto.TextEdit{
|
||||
NewText: "a@b",
|
||||
Range: f.Ranges()[1].LSRange,
|
||||
},
|
||||
},
|
||||
},
|
||||
&lsproto.CompletionItem{
|
||||
Label: "b@a",
|
||||
TextEdit: &lsproto.TextEditOrInsertReplaceEdit{
|
||||
TextEdit: &lsproto.TextEdit{
|
||||
NewText: "b@a",
|
||||
Range: f.Ranges()[1].LSRange,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, "3", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Exact: []fourslash.CompletionsExpectedItem{
|
||||
&lsproto.CompletionItem{
|
||||
Label: "a.b",
|
||||
TextEdit: &lsproto.TextEditOrInsertReplaceEdit{
|
||||
TextEdit: &lsproto.TextEdit{
|
||||
NewText: "a.b",
|
||||
Range: f.Ranges()[2].LSRange,
|
||||
},
|
||||
},
|
||||
},
|
||||
&lsproto.CompletionItem{
|
||||
Label: "b.a",
|
||||
TextEdit: &lsproto.TextEditOrInsertReplaceEdit{
|
||||
TextEdit: &lsproto.TextEdit{
|
||||
NewText: "b.a",
|
||||
Range: f.Ranges()[2].LSRange,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, "4", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Exact: []fourslash.CompletionsExpectedItem{
|
||||
&lsproto.CompletionItem{
|
||||
Label: "a'b",
|
||||
TextEdit: &lsproto.TextEditOrInsertReplaceEdit{
|
||||
TextEdit: &lsproto.TextEdit{
|
||||
NewText: "a'b",
|
||||
Range: f.Ranges()[3].LSRange,
|
||||
},
|
||||
},
|
||||
},
|
||||
&lsproto.CompletionItem{
|
||||
Label: "b'a",
|
||||
TextEdit: &lsproto.TextEditOrInsertReplaceEdit{
|
||||
TextEdit: &lsproto.TextEdit{
|
||||
NewText: "b'a",
|
||||
Range: f.Ranges()[3].LSRange,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, "5", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Exact: []fourslash.CompletionsExpectedItem{
|
||||
&lsproto.CompletionItem{
|
||||
Label: "a`b",
|
||||
TextEdit: &lsproto.TextEditOrInsertReplaceEdit{
|
||||
TextEdit: &lsproto.TextEdit{
|
||||
NewText: "a`b",
|
||||
Range: f.Ranges()[4].LSRange,
|
||||
},
|
||||
},
|
||||
},
|
||||
&lsproto.CompletionItem{
|
||||
Label: "b`a",
|
||||
TextEdit: &lsproto.TextEditOrInsertReplaceEdit{
|
||||
TextEdit: &lsproto.TextEdit{
|
||||
NewText: "b`a",
|
||||
Range: f.Ranges()[4].LSRange,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, "6", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Exact: []fourslash.CompletionsExpectedItem{
|
||||
&lsproto.CompletionItem{
|
||||
Label: "a\"b",
|
||||
TextEdit: &lsproto.TextEditOrInsertReplaceEdit{
|
||||
TextEdit: &lsproto.TextEdit{
|
||||
NewText: "a\"b",
|
||||
Range: f.Ranges()[5].LSRange,
|
||||
},
|
||||
},
|
||||
},
|
||||
&lsproto.CompletionItem{
|
||||
Label: "b\"a",
|
||||
TextEdit: &lsproto.TextEditOrInsertReplaceEdit{
|
||||
TextEdit: &lsproto.TextEdit{
|
||||
NewText: "b\"a",
|
||||
Range: f.Ranges()[5].LSRange,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
f.VerifyCompletions(t, "7", &fourslash.CompletionsExpectedList{
|
||||
IsIncomplete: false,
|
||||
ItemDefaults: &fourslash.CompletionsExpectedItemDefaults{
|
||||
CommitCharacters: &DefaultCommitCharacters,
|
||||
EditRange: Ignored,
|
||||
},
|
||||
Items: &fourslash.CompletionsExpectedItems{
|
||||
Exact: []fourslash.CompletionsExpectedItem{
|
||||
&lsproto.CompletionItem{
|
||||
Label: "a<b",
|
||||
TextEdit: &lsproto.TextEditOrInsertReplaceEdit{
|
||||
TextEdit: &lsproto.TextEdit{
|
||||
NewText: "a<b",
|
||||
Range: f.Ranges()[6].LSRange,
|
||||
},
|
||||
},
|
||||
},
|
||||
&lsproto.CompletionItem{
|
||||
Label: "b<a",
|
||||
TextEdit: &lsproto.TextEditOrInsertReplaceEdit{
|
||||
TextEdit: &lsproto.TextEdit{
|
||||
NewText: "b<a",
|
||||
Range: f.Ranges()[6].LSRange,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user