@@ -10,6 +10,7 @@ import * as crossFile from 'aws-core-vscode/codewhisperer'
1010import { TestFolder , assertTabCount } from 'aws-core-vscode/test'
1111import { FeatureConfigProvider } from 'aws-core-vscode/codewhisperer'
1212import { toTextEditor } from 'aws-core-vscode/test'
13+ import { LspController } from 'aws-core-vscode/amazonq'
1314
1415describe ( 'supplementalContextUtil' , function ( ) {
1516 let testFolder : TestFolder
@@ -31,6 +32,16 @@ describe('supplementalContextUtil', function () {
3132 describe ( 'fetchSupplementalContext' , function ( ) {
3233 describe ( 'openTabsContext' , function ( ) {
3334 it ( 'opentabContext should include chunks if non empty' , async function ( ) {
35+ sinon
36+ . stub ( LspController . instance , 'queryInlineProjectContext' )
37+ . withArgs ( sinon . match . any , sinon . match . any , 'codemap' )
38+ . resolves ( [
39+ {
40+ content : 'foo' ,
41+ score : 0 ,
42+ filePath : 'q-inline' ,
43+ } ,
44+ ] )
3445 await toTextEditor ( 'class Foo' , 'Foo.java' , testFolder . path , { preview : false } )
3546 await toTextEditor ( 'class Bar' , 'Bar.java' , testFolder . path , { preview : false } )
3647 await toTextEditor ( 'class Baz' , 'Baz.java' , testFolder . path , { preview : false } )
@@ -42,7 +53,7 @@ describe('supplementalContextUtil', function () {
4253 await assertTabCount ( 4 )
4354
4455 const actual = await crossFile . fetchSupplementalContext ( editor , fakeCancellationToken )
45- assert . ok ( actual ?. supplementalContextItems . length === 3 )
56+ assert . ok ( actual ?. supplementalContextItems . length === 4 )
4657 } )
4758
4859 it ( 'opentabsContext should filter out empty chunks' , async function ( ) {
0 commit comments