Skip to content

Commit 3d48fe6

Browse files
committed
Merge branch 'master' into auth/telemetryDebugging
2 parents b9c0066 + 50c9121 commit 3d48fe6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1783
-446
lines changed

package-lock.json

Lines changed: 49 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Bug Fix",
3+
"description": "Fix language server start failure in AL2023 ARM64"
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "Inline suggestions: Pre-fetch recommendations to reduce suggestion latency."
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "Added github issue link and description to the chat answer feedback form"
4+
}

packages/amazonq/test/unit/codewhisperer/commands/onAcceptance.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,21 @@ import * as sinon from 'sinon'
99
import {
1010
onAcceptance,
1111
AcceptedSuggestionEntry,
12-
session,
12+
CodeWhispererSessionState,
1313
CodeWhispererTracker,
1414
RecommendationHandler,
1515
AuthUtil,
16+
CodeWhispererSession,
1617
} from 'aws-core-vscode/codewhisperer'
1718
import { resetCodeWhispererGlobalVariables, createMockTextEditor } from 'aws-core-vscode/test'
1819
import { assertTelemetryCurried } from 'aws-core-vscode/test'
1920

2021
describe('onAcceptance', function () {
22+
let session: CodeWhispererSession
2123
describe('onAcceptance', function () {
2224
beforeEach(async function () {
25+
session = CodeWhispererSessionState.instance.getSession()
2326
await resetCodeWhispererGlobalVariables()
24-
session.reset()
2527
})
2628

2729
afterEach(function () {

packages/amazonq/test/unit/codewhisperer/commands/onInlineAcceptance.test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,22 @@ import * as vscode from 'vscode'
88
import * as sinon from 'sinon'
99
import { resetCodeWhispererGlobalVariables, createMockTextEditor } from 'aws-core-vscode/test'
1010
import { assertTelemetryCurried } from 'aws-core-vscode/test'
11-
import { onInlineAcceptance, RecommendationHandler, AuthUtil, session } from 'aws-core-vscode/codewhisperer'
11+
import {
12+
onInlineAcceptance,
13+
RecommendationHandler,
14+
AuthUtil,
15+
CodeWhispererSessionState,
16+
CodeWhispererSession,
17+
} from 'aws-core-vscode/codewhisperer'
1218
import { globals } from 'aws-core-vscode/shared'
1319
import { extensionVersion } from 'aws-core-vscode/shared'
1420

1521
describe('onInlineAcceptance', function () {
22+
let session: CodeWhispererSession
1623
describe('onInlineAcceptance', function () {
1724
beforeEach(async function () {
25+
session = CodeWhispererSessionState.instance.getSession()
1826
await resetCodeWhispererGlobalVariables()
19-
session.reset()
2027
})
2128

2229
afterEach(function () {

packages/amazonq/test/unit/codewhisperer/service/completionProvider.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
getLabel,
1313
Recommendation,
1414
RecommendationHandler,
15-
session,
15+
CodeWhispererSessionState,
1616
} from 'aws-core-vscode/codewhisperer'
1717
import { createMockDocument, resetCodeWhispererGlobalVariables } from 'aws-core-vscode/test'
1818

@@ -39,6 +39,7 @@ describe('completionProviderService', function () {
3939

4040
describe('getCompletionItem', function () {
4141
it('should return targetCompletionItem given input', function () {
42+
const session = CodeWhispererSessionState.instance.getSession()
4243
session.startPos = new vscode.Position(0, 0)
4344
RecommendationHandler.instance.requestId = 'mock_requestId_getCompletionItem'
4445
session.sessionId = 'mock_sessionId_getCompletionItem'
@@ -95,6 +96,7 @@ describe('completionProviderService', function () {
9596

9697
describe('getCompletionItems', function () {
9798
it('should return completion items for each non-empty recommendation', async function () {
99+
const session = CodeWhispererSessionState.instance.getSession()
98100
session.recommendations = [
99101
{ content: "\n\t\tconsole.log('Hello world!');\n\t}" },
100102
{ content: '\nvar a = 10' },
@@ -106,6 +108,7 @@ describe('completionProviderService', function () {
106108
})
107109

108110
it('should return empty completion items when recommendation is empty', async function () {
111+
const session = CodeWhispererSessionState.instance.getSession()
109112
session.recommendations = []
110113
const mockPosition = new vscode.Position(14, 83)
111114
const mockDocument = createMockDocument()

packages/amazonq/test/unit/codewhisperer/service/inlineCompletionService.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
CodeSuggestionsState,
1515
ConfigurationEntry,
1616
CWInlineCompletionItemProvider,
17-
session,
17+
CodeWhispererSessionState,
1818
AuthUtil,
1919
listCodeWhispererCommandsId,
2020
DefaultCodeWhispererClient,
@@ -46,6 +46,7 @@ describe('inlineCompletionService', function () {
4646
})
4747

4848
it('should call checkAndResetCancellationTokens before showing inline and next token to be null', async function () {
49+
const session = CodeWhispererSessionState.instance.getSession()
4950
const mockEditor = createMockTextEditor()
5051
sinon.stub(RecommendationHandler.instance, 'getRecommendations').resolves({
5152
result: 'Succeeded',
@@ -70,6 +71,7 @@ describe('inlineCompletionService', function () {
7071

7172
describe('clearInlineCompletionStates', function () {
7273
it('should remove inline reference and recommendations', async function () {
74+
const session = CodeWhispererSessionState.instance.getSession()
7375
const fakeReferences = [
7476
{
7577
message: '',

0 commit comments

Comments
 (0)