Skip to content

Commit 0990c31

Browse files
committed
Refactor test, add new (failing) test for dotted with a desirable snippet completion
1 parent f158365 commit 0990c31

File tree

2 files changed

+38
-5
lines changed

2 files changed

+38
-5
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/// <reference path="fourslash.ts" />
2+
//@Filename: file.tsx
3+
////interface NestedInterface {
4+
//// Foo: NestedInterface;
5+
//// (props: {className?: string}): any;
6+
////}
7+
////
8+
////declare const Foo: NestedInterface;
9+
////
10+
////function fn1() {
11+
//// return <Foo>
12+
//// <Foo /*1*/
13+
//// </Foo>
14+
////}
15+
////function fn2() {
16+
//// return <Foo>
17+
//// <Foo.Foo /*2*/
18+
//// </Foo>
19+
////}
20+
21+
verify.completions(
22+
{
23+
marker: test.markers(),
24+
includes: [
25+
{ name: "className", insertText: 'className={$1}', isSnippet: true, sortText: completion.SortText.OptionalMember }
26+
],
27+
preferences: {
28+
jsxAttributeCompletionStyle: "braces",
29+
includeCompletionsWithSnippetText: true,
30+
includeCompletionsWithInsertText: true,
31+
},
32+
}
33+
)

tests/cases/fourslash/jsxTagNameDottedNoSnippet.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
//// </Foo>
3939
////}
4040

41-
for (const marker of test.markers()) {
42-
verify.completions({
43-
marker,
41+
verify.completions(
42+
{
43+
marker: test.markers(),
4444
includes: [
4545
{ name: "Foo", insertText: undefined, isSnippet: undefined }
4646
],
@@ -49,5 +49,5 @@ for (const marker of test.markers()) {
4949
includeCompletionsWithSnippetText: true,
5050
includeCompletionsWithInsertText: true,
5151
},
52-
})
53-
}
52+
}
53+
)

0 commit comments

Comments
 (0)