@@ -60,40 +60,41 @@ describe('crossFileContextUtil', function () {
6060 assert . strictEqual ( actual . supplementalContextItems [ 1 ] . content . split ( '\n' ) . length , 50 )
6161 assert . strictEqual ( actual . supplementalContextItems [ 2 ] . content . split ( '\n' ) . length , 50 )
6262 } )
63-
64- it ( 'for t1 group, should return repomap + opentabs context' , async function ( ) {
65- await toTextEditor ( aStringWithLineCount ( 200 ) , 'CrossFile.java' , tempFolder , { preview : false } )
66- const myCurrentEditor = await toTextEditor ( '' , 'TargetFile.java' , tempFolder , {
67- preview : false ,
63+ Array . from ( { length : 5000 } ) . forEach ( ( _ ) => {
64+ it ( 'for t1 group, should return repomap + opentabs context' , async function ( ) {
65+ await toTextEditor ( aStringWithLineCount ( 200 ) , 'CrossFile.java' , tempFolder , { preview : false } )
66+ const myCurrentEditor = await toTextEditor ( '' , 'TargetFile.java' , tempFolder , {
67+ preview : false ,
68+ } )
69+
70+ await assertTabCount ( 2 )
71+
72+ sinon . stub ( FeatureConfigProvider . instance , 'getProjectContextGroup' ) . returns ( 't1' )
73+ sinon
74+ . stub ( LspController . instance , 'queryInlineProjectContext' )
75+ . withArgs ( sinon . match . any , sinon . match . any , 'codemap' )
76+ . resolves ( [
77+ {
78+ content : 'foo' ,
79+ score : 0 ,
80+ filePath : 'q-inline' ,
81+ } ,
82+ ] )
83+
84+ const actual = await crossFile . fetchSupplementalContextForSrc ( myCurrentEditor , fakeCancellationToken )
85+ assert . ok ( actual )
86+ assert . strictEqual ( actual . supplementalContextItems . length , 4 )
87+ assert . strictEqual ( actual ?. strategy , 'codemap' )
88+ assert . deepEqual ( actual ?. supplementalContextItems [ 0 ] , {
89+ content : 'foo' ,
90+ score : 0 ,
91+ filePath : 'q-inline' ,
92+ } )
93+
94+ assert . strictEqual ( actual . supplementalContextItems [ 1 ] . content . split ( '\n' ) . length , 50 )
95+ assert . strictEqual ( actual . supplementalContextItems [ 2 ] . content . split ( '\n' ) . length , 50 )
96+ assert . strictEqual ( actual . supplementalContextItems [ 3 ] . content . split ( '\n' ) . length , 50 )
6897 } )
69-
70- await assertTabCount ( 2 )
71-
72- sinon . stub ( FeatureConfigProvider . instance , 'getProjectContextGroup' ) . returns ( 't1' )
73- sinon
74- . stub ( LspController . instance , 'queryInlineProjectContext' )
75- . withArgs ( sinon . match . any , sinon . match . any , 'codemap' )
76- . resolves ( [
77- {
78- content : 'foo' ,
79- score : 0 ,
80- filePath : 'q-inline' ,
81- } ,
82- ] )
83-
84- const actual = await crossFile . fetchSupplementalContextForSrc ( myCurrentEditor , fakeCancellationToken )
85- assert . ok ( actual )
86- assert . strictEqual ( actual . supplementalContextItems . length , 4 )
87- assert . strictEqual ( actual ?. strategy , 'codemap' )
88- assert . deepEqual ( actual ?. supplementalContextItems [ 0 ] , {
89- content : 'foo' ,
90- score : 0 ,
91- filePath : 'q-inline' ,
92- } )
93-
94- assert . strictEqual ( actual . supplementalContextItems [ 1 ] . content . split ( '\n' ) . length , 50 )
95- assert . strictEqual ( actual . supplementalContextItems [ 2 ] . content . split ( '\n' ) . length , 50 )
96- assert . strictEqual ( actual . supplementalContextItems [ 3 ] . content . split ( '\n' ) . length , 50 )
9798 } )
9899
99100 it ( 'for t2 group, should return global bm25 context and no repomap' , async function ( ) {
0 commit comments