Skip to content

Commit 33f939b

Browse files
committed
Revert "fix(amazonq): Use document change event for auto trigger classifier input (aws#7697)"
This reverts commit f2e9403.
1 parent dabf574 commit 33f939b

File tree

6 files changed

+13
-33
lines changed

6 files changed

+13
-33
lines changed

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/amazonq/.changes/next-release/Bug Fix-9d694e40-7fc7-4504-b08c-6b22a5ebcb1c.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/amazonq/src/app/inline/completion.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
335335
context,
336336
token,
337337
isAutoTrigger,
338-
getAllRecommendationsOptions,
339-
this.documentEventListener.getLastDocumentChangeEvent(document.uri.fsPath)?.event
338+
getAllRecommendationsOptions
340339
)
341340
// get active item from session for displaying
342341
const items = this.sessionManager.getActiveRecommendation()

packages/amazonq/src/app/inline/recommendationService.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
5-
import * as vscode from 'vscode'
65
import {
76
InlineCompletionListWithReferences,
87
InlineCompletionWithReferencesParams,
98
inlineCompletionWithReferencesRequestType,
10-
TextDocumentContentChangeEvent,
119
} from '@aws/language-server-runtimes/protocol'
1210
import { CancellationToken, InlineCompletionContext, Position, TextDocument } from 'vscode'
1311
import { LanguageClient } from 'vscode-languageclient'
@@ -42,28 +40,17 @@ export class RecommendationService {
4240
context: InlineCompletionContext,
4341
token: CancellationToken,
4442
isAutoTrigger: boolean,
45-
options: GetAllRecommendationsOptions = { emitTelemetry: true, showUi: true },
46-
documentChangeEvent?: vscode.TextDocumentChangeEvent
43+
options: GetAllRecommendationsOptions = { emitTelemetry: true, showUi: true }
4744
) {
4845
// Record that a regular request is being made
4946
this.cursorUpdateRecorder?.recordCompletionRequest()
50-
const documentChangeParams = documentChangeEvent
51-
? {
52-
textDocument: {
53-
uri: document.uri.toString(),
54-
version: document.version,
55-
},
56-
contentChanges: documentChangeEvent.contentChanges.map((x) => x as TextDocumentContentChangeEvent),
57-
}
58-
: undefined
5947

6048
let request: InlineCompletionWithReferencesParams = {
6149
textDocument: {
6250
uri: document.uri.toString(),
6351
},
6452
position,
6553
context,
66-
documentChangeParams: documentChangeParams,
6754
}
6855
if (options.editsStreakToken) {
6956
request = { ...request, partialResultToken: options.editsStreakToken }

packages/amazonq/test/unit/amazonq/apps/inline/recommendationService.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ describe('RecommendationService', () => {
146146
},
147147
position: mockPosition,
148148
context: mockContext,
149-
documentChangeParams: undefined,
150149
})
151150

152151
// Verify session management
@@ -188,7 +187,6 @@ describe('RecommendationService', () => {
188187
},
189188
position: mockPosition,
190189
context: mockContext,
191-
documentChangeParams: undefined,
192190
}
193191
const secondRequestArgs = sendRequestStub.secondCall.args[1]
194192
assert.deepStrictEqual(firstRequestArgs, expectedRequestArgs)

packages/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,8 @@
471471
"@aws-sdk/types": "^3.13.1",
472472
"@aws/chat-client": "^0.1.4",
473473
"@aws/chat-client-ui-types": "^0.1.47",
474-
"@aws/language-server-runtimes": "^0.2.111",
475-
"@aws/language-server-runtimes-types": "^0.1.47",
474+
"@aws/language-server-runtimes": "^0.2.102",
475+
"@aws/language-server-runtimes-types": "^0.1.43",
476476
"@cspotcode/source-map-support": "^0.8.1",
477477
"@sinonjs/fake-timers": "^10.0.2",
478478
"@types/adm-zip": "^0.4.34",

0 commit comments

Comments
 (0)