@@ -529,6 +529,10 @@ test('Fix properties sorting', () => {
529
529
530
530
declare function MyComponent(props: { b?; c? } & { a? }): JSX.Element
531
531
<MyComponent /*4*/ />;
532
+ <MyComponent
533
+ c=''
534
+ /*41*/
535
+ />;
532
536
533
537
let a: { b:{}, a() } = {
534
538
/*5*/
@@ -542,6 +546,7 @@ test('Fix properties sorting', () => {
542
546
assertSorted ( 2 , [ 'c' , 'b' ] )
543
547
assertSorted ( 3 , [ 'c' , 'b' ] )
544
548
assertSorted ( 4 , [ 'b' , 'c' , 'a' ] )
549
+ assertSorted ( 41 , [ 'b' , 'a' ] )
545
550
assertSorted ( 5 , [ 'b' , 'b' , 'a' , 'a' ] )
546
551
settingsOverride . fixSuggestionsSorting = false
547
552
} )
@@ -569,12 +574,37 @@ testTs5('Change to function kind', () => {
569
574
settingsOverride [ 'experiments.changeKindToFunction' ] = false
570
575
} )
571
576
572
- testTs5 ( 'Filter JSX Components' , ( ) => {
573
- const tester = fourslashLikeTester ( /* ts */ `
574
- const a = () => {}
575
- a/*1*/
577
+ testTs5 . only ( 'Filter JSX Components' , ( ) => {
578
+ overrideSettings ( {
579
+ // improveJsxCompletions: false,
580
+ 'experiments.excludeNonJsxCompletions' : true ,
581
+ } )
582
+ const tester = fourslashLikeTester ( /* tsx */ `
583
+ const someFunction = () => {}
584
+ declare namespace JSX {
585
+ interface IntrinsicElements {
586
+ superSpan: any;
587
+ }
588
+ }
589
+ // return < // TODO
590
+ return <s/*1*/
576
591
` )
577
- // TODO
592
+ tester . completion ( 1 , {
593
+ excludes : [ 'someFunction' ] ,
594
+ includes : {
595
+ names : [ 'superSpan' ] ,
596
+ } ,
597
+ } )
598
+ // https://github.com/zardoy/typescript-vscode-plugins/issues/205
599
+ const tester2 = fourslashLikeTester ( /* tsx */ `
600
+ const Img = ({ alt }) => {}
601
+ <Img\n\t/*1*/\n/>
602
+ ` )
603
+ tester2 . completion ( 1 , {
604
+ includes : {
605
+ names : [ 'alt' ] ,
606
+ } ,
607
+ } )
578
608
} )
579
609
580
610
test ( 'Omit<..., ""> suggestions' , ( ) => {
0 commit comments