@@ -529,6 +529,10 @@ test('Fix properties sorting', () => {
529529
530530 declare function MyComponent(props: { b?; c? } & { a? }): JSX.Element
531531 <MyComponent /*4*/ />;
532+ <MyComponent
533+ c=''
534+ /*41*/
535+ />;
532536
533537 let a: { b:{}, a() } = {
534538 /*5*/
@@ -542,6 +546,7 @@ test('Fix properties sorting', () => {
542546 assertSorted ( 2 , [ 'c' , 'b' ] )
543547 assertSorted ( 3 , [ 'c' , 'b' ] )
544548 assertSorted ( 4 , [ 'b' , 'c' , 'a' ] )
549+ assertSorted ( 41 , [ 'b' , 'a' ] )
545550 assertSorted ( 5 , [ 'b' , 'b' , 'a' , 'a' ] )
546551 settingsOverride . fixSuggestionsSorting = false
547552} )
@@ -569,12 +574,37 @@ testTs5('Change to function kind', () => {
569574 settingsOverride [ 'experiments.changeKindToFunction' ] = false
570575} )
571576
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*/
576591 ` )
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+ } )
578608} )
579609
580610test ( 'Omit<..., ""> suggestions' , ( ) => {
0 commit comments