diff --git a/package-lock.json b/package-lock.json index 8674fcc5e67..b85728e18b8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15044,13 +15044,13 @@ } }, "node_modules/@aws/language-server-runtimes": { - "version": "0.2.111", - "resolved": "https://registry.npmjs.org/@aws/language-server-runtimes/-/language-server-runtimes-0.2.111.tgz", - "integrity": "sha512-eIHKzWkLTTb3qUCeT2nIrpP99dEv/OiUOcPB00MNCsOPWBBO/IoZhfGRNrE8+stgZMQkKLFH2ZYxn3ByB6OsCQ==", + "version": "0.2.119", + "resolved": "https://registry.npmjs.org/@aws/language-server-runtimes/-/language-server-runtimes-0.2.119.tgz", + "integrity": "sha512-zHonaOBuZ9K81/EQ1hg6ieu45YK7J5M6kiFD/dpdwJwsU36Ia4rbnN2W5ZIDPryZ9Hx9WYpw72YBl+q8+6BdGQ==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@aws/language-server-runtimes-types": "^0.1.47", + "@aws/language-server-runtimes-types": "^0.1.51", "@opentelemetry/api": "^1.9.0", "@opentelemetry/api-logs": "^0.200.0", "@opentelemetry/core": "^2.0.0", @@ -15077,9 +15077,9 @@ } }, "node_modules/@aws/language-server-runtimes-types": { - "version": "0.1.47", - "resolved": "https://registry.npmjs.org/@aws/language-server-runtimes-types/-/language-server-runtimes-types-0.1.47.tgz", - "integrity": "sha512-l5dOdx/MR3SO0HYXkSL9fcR05f4Aw7qRMuASMdWOK93LOSZeANPVOGIWblRnoJejfYiPXcufCFyjLnGpATExag==", + "version": "0.1.51", + "resolved": "https://registry.npmjs.org/@aws/language-server-runtimes-types/-/language-server-runtimes-types-0.1.51.tgz", + "integrity": "sha512-TuCA821MSRCpO/1thhHaBRpKzU/CiHM/Bvd6quJRUKwvSb8/gTG1mSBp2YoHYx4p7FUZYBko2DKDmpaB1WfvUw==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -30063,7 +30063,7 @@ "@aws-sdk/types": "^3.13.1", "@aws/chat-client": "^0.1.4", "@aws/chat-client-ui-types": "^0.1.47", - "@aws/language-server-runtimes": "^0.2.111", + "@aws/language-server-runtimes": "^0.2.119", "@aws/language-server-runtimes-types": "^0.1.47", "@cspotcode/source-map-support": "^0.8.1", "@sinonjs/fake-timers": "^10.0.2", diff --git a/packages/amazonq/src/app/inline/recommendationService.ts b/packages/amazonq/src/app/inline/recommendationService.ts index 1ff060c5a70..a722693fa97 100644 --- a/packages/amazonq/src/app/inline/recommendationService.ts +++ b/packages/amazonq/src/app/inline/recommendationService.ts @@ -21,6 +21,7 @@ import { import { TelemetryHelper } from './telemetryHelper' import { ICursorUpdateRecorder } from './cursorUpdateManager' import { getLogger } from 'aws-core-vscode/shared' +import { getOpenFilesInWindow } from 'aws-core-vscode/utils' import { asyncCallWithTimeout } from '../../util/timeoutUtil' export interface GetAllRecommendationsOptions { @@ -79,7 +80,7 @@ export class RecommendationService { contentChanges: documentChangeEvent.contentChanges.map((x) => x as TextDocumentContentChangeEvent), } : undefined - + const openTabs = await getOpenFilesInWindow() let request: InlineCompletionWithReferencesParams = { textDocument: { uri: document.uri.toString(), @@ -87,6 +88,7 @@ export class RecommendationService { position, context, documentChangeParams: documentChangeParams, + openTabFilepaths: openTabs, } if (options.editsStreakToken) { request = { ...request, partialResultToken: options.editsStreakToken } diff --git a/packages/amazonq/test/unit/amazonq/apps/inline/recommendationService.test.ts b/packages/amazonq/test/unit/amazonq/apps/inline/recommendationService.test.ts index 54eea8347c5..559ecdb2102 100644 --- a/packages/amazonq/test/unit/amazonq/apps/inline/recommendationService.test.ts +++ b/packages/amazonq/test/unit/amazonq/apps/inline/recommendationService.test.ts @@ -147,6 +147,7 @@ describe('RecommendationService', () => { position: mockPosition, context: mockContext, documentChangeParams: undefined, + openTabFilepaths: [], }) // Verify session management @@ -189,6 +190,7 @@ describe('RecommendationService', () => { position: mockPosition, context: mockContext, documentChangeParams: undefined, + openTabFilepaths: [], } const secondRequestArgs = sendRequestStub.secondCall.args[1] assert.deepStrictEqual(firstRequestArgs, expectedRequestArgs) diff --git a/packages/core/package.json b/packages/core/package.json index d446a1bdf41..7be37423006 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -471,7 +471,7 @@ "@aws-sdk/types": "^3.13.1", "@aws/chat-client": "^0.1.4", "@aws/chat-client-ui-types": "^0.1.47", - "@aws/language-server-runtimes": "^0.2.111", + "@aws/language-server-runtimes": "^0.2.119", "@aws/language-server-runtimes-types": "^0.1.47", "@cspotcode/source-map-support": "^0.8.1", "@sinonjs/fake-timers": "^10.0.2", diff --git a/packages/core/src/shared/utilities/index.ts b/packages/core/src/shared/utilities/index.ts index 18d86da4d55..a361834406c 100644 --- a/packages/core/src/shared/utilities/index.ts +++ b/packages/core/src/shared/utilities/index.ts @@ -8,3 +8,4 @@ export { VSCODE_EXTENSION_ID } from '../extensions' export * from './functionUtils' export * as messageUtils from './messages' export * as CommentUtils from './commentUtils' +export * from './editorUtilities'