Skip to content

Commit 63322df

Browse files
authored
Merge branch 'master' into dmsUpdates
2 parents f4d82a4 + 1d86309 commit 63322df

Some content is hidden

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

44 files changed

+562
-254
lines changed

package-lock.json

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

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
},
7272
"dependencies": {
7373
"@types/node": "^22.7.5",
74-
"@aws-toolkits/telemetry": "^1.0.242",
7574
"vscode-nls": "^5.2.0",
7675
"vscode-nls-dev": "^4.0.4"
7776
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"date": "2024-11-14",
3+
"version": "1.36.0",
4+
"entries": [
5+
{
6+
"type": "Bug Fix",
7+
"description": "Fix broken inline suggestion auto-trigger on Systemverfilog files if users dont have systemverilog extension installed and enabled"
8+
},
9+
{
10+
"type": "Bug Fix",
11+
"description": "tutorial always showing on start"
12+
},
13+
{
14+
"type": "Feature",
15+
"description": "Enable default `@workspace` context of Amazon Q chat for certain users"
16+
},
17+
{
18+
"type": "Feature",
19+
"description": "Amazon Q /dev: Add an action to accept individual files"
20+
}
21+
]
22+
}

packages/amazonq/.changes/next-release/Bug Fix-30c6bfc4-9411-4bc4-bfd1-41305859109d.json

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

packages/amazonq/.changes/next-release/Bug Fix-46c5fb9b-1b36-4826-8520-ec03409bce79.json

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

packages/amazonq/.changes/next-release/Feature-93485fee-05c0-4dc9-abde-9072590cbd45.json

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

packages/amazonq/.changes/next-release/Feature-d18cffcd-fd30-4936-9586-587b0ba88ec9.json

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

packages/amazonq/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 1.36.0 2024-11-14
2+
3+
- **Bug Fix** Fix broken inline suggestion auto-trigger on Systemverfilog files if users dont have systemverilog extension installed and enabled
4+
- **Bug Fix** tutorial always showing on start
5+
- **Feature** Enable default `@workspace` context of Amazon Q chat for certain users
6+
- **Feature** Amazon Q /dev: Add an action to accept individual files
7+
18
## 1.35.0 2024-11-11
29

310
- **Breaking Change** Change focus chat keybind to win+alt+i on Windows, cmd+alt+i on macOS, and meta+alt+i on Linux

packages/amazonq/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "amazon-q-vscode",
33
"displayName": "Amazon Q",
44
"description": "Amazon Q is your generative AI-powered assistant across the software development lifecycle.",
5-
"version": "1.36.0-SNAPSHOT",
5+
"version": "1.37.0-SNAPSHOT",
66
"extensionKind": [
77
"workspace"
88
],

packages/amazonq/test/unit/codewhisperer/util/crossFileContextUtil.test.ts

Lines changed: 112 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
} from 'aws-core-vscode/test'
2020
import { areEqual, normalize } from 'aws-core-vscode/shared'
2121
import * as path from 'path'
22+
import { LspController } from 'aws-core-vscode/amazonq'
2223

2324
let tempFolder: string
2425

@@ -39,8 +40,12 @@ describe('crossFileContextUtil', function () {
3940
tempFolder = (await createTestWorkspaceFolder()).uri.fsPath
4041
})
4142

42-
it('opentabs context should fetch 3 chunks and each chunk should contains 50 lines', async function () {
43-
sinon.stub(FeatureConfigProvider.instance, 'isNewProjectContextGroup').alwaysReturned(false)
43+
afterEach(async function () {
44+
sinon.restore()
45+
})
46+
47+
it('for control group, should return opentabs context where there will be 3 chunks and each chunk should contains 50 lines', async function () {
48+
sinon.stub(FeatureConfigProvider.instance, 'getProjectContextGroup').returns('control')
4449
await toTextEditor(aStringWithLineCount(200), 'CrossFile.java', tempFolder, { preview: false })
4550
const myCurrentEditor = await toTextEditor('', 'TargetFile.java', tempFolder, {
4651
preview: false,
@@ -53,6 +58,110 @@ describe('crossFileContextUtil', function () {
5358
assert.strictEqual(actual.supplementalContextItems[1].content.split('\n').length, 50)
5459
assert.strictEqual(actual.supplementalContextItems[2].content.split('\n').length, 50)
5560
})
61+
62+
it('for t1 group, should return repomap + opentabs context', async function () {
63+
await toTextEditor(aStringWithLineCount(200), 'CrossFile.java', tempFolder, { preview: false })
64+
const myCurrentEditor = await toTextEditor('', 'TargetFile.java', tempFolder, {
65+
preview: false,
66+
})
67+
sinon.stub(FeatureConfigProvider.instance, 'getProjectContextGroup').returns('t1')
68+
sinon
69+
.stub(LspController.instance, 'queryInlineProjectContext')
70+
.withArgs(sinon.match.any, sinon.match.any, 'codemap')
71+
.resolves([
72+
{
73+
content: 'foo',
74+
score: 0,
75+
filePath: 'q-inline',
76+
},
77+
])
78+
79+
const actual = await crossFile.fetchSupplementalContextForSrc(myCurrentEditor, fakeCancellationToken)
80+
assert.ok(actual)
81+
assert.ok(actual.supplementalContextItems.length === 4)
82+
assert.strictEqual(actual?.strategy, 'codemap')
83+
assert.deepEqual(actual?.supplementalContextItems[0], {
84+
content: 'foo',
85+
score: 0,
86+
filePath: 'q-inline',
87+
})
88+
89+
assert.strictEqual(actual.supplementalContextItems[1].content.split('\n').length, 50)
90+
assert.strictEqual(actual.supplementalContextItems[2].content.split('\n').length, 50)
91+
assert.strictEqual(actual.supplementalContextItems[3].content.split('\n').length, 50)
92+
})
93+
94+
it('for t2 group, should return global bm25 context and no repomap', async function () {
95+
await toTextEditor(aStringWithLineCount(200), 'CrossFile.java', tempFolder, { preview: false })
96+
const myCurrentEditor = await toTextEditor('', 'TargetFile.java', tempFolder, {
97+
preview: false,
98+
})
99+
sinon.stub(FeatureConfigProvider.instance, 'getProjectContextGroup').returns('t2')
100+
sinon
101+
.stub(LspController.instance, 'queryInlineProjectContext')
102+
.withArgs(sinon.match.any, sinon.match.any, 'bm25')
103+
.resolves([
104+
{
105+
content: 'foo',
106+
score: 5,
107+
filePath: 'foo.java',
108+
},
109+
{
110+
content: 'bar',
111+
score: 4,
112+
filePath: 'bar.java',
113+
},
114+
{
115+
content: 'baz',
116+
score: 3,
117+
filePath: 'baz.java',
118+
},
119+
{
120+
content: 'qux',
121+
score: 2,
122+
filePath: 'qux.java',
123+
},
124+
{
125+
content: 'quux',
126+
score: 1,
127+
filePath: 'quux.java',
128+
},
129+
])
130+
131+
const actual = await crossFile.fetchSupplementalContextForSrc(myCurrentEditor, fakeCancellationToken)
132+
assert.ok(actual)
133+
assert.ok(actual.supplementalContextItems.length === 5)
134+
assert.strictEqual(actual?.strategy, 'bm25')
135+
136+
assert.deepEqual(actual?.supplementalContextItems[0], {
137+
content: 'foo',
138+
score: 5,
139+
filePath: 'foo.java',
140+
})
141+
142+
assert.deepEqual(actual?.supplementalContextItems[1], {
143+
content: 'bar',
144+
score: 4,
145+
filePath: 'bar.java',
146+
})
147+
assert.deepEqual(actual?.supplementalContextItems[2], {
148+
content: 'baz',
149+
score: 3,
150+
filePath: 'baz.java',
151+
})
152+
153+
assert.deepEqual(actual?.supplementalContextItems[3], {
154+
content: 'qux',
155+
score: 2,
156+
filePath: 'qux.java',
157+
})
158+
159+
assert.deepEqual(actual?.supplementalContextItems[4], {
160+
content: 'quux',
161+
score: 1,
162+
filePath: 'quux.java',
163+
})
164+
})
56165
})
57166

58167
describe('non supported language should return undefined', function () {
@@ -212,7 +321,7 @@ describe('crossFileContextUtil', function () {
212321

213322
fileExtLists.forEach((fileExt) => {
214323
it('should be non empty', async function () {
215-
sinon.stub(FeatureConfigProvider.instance, 'isNewProjectContextGroup').alwaysReturned(false)
324+
sinon.stub(FeatureConfigProvider.instance, 'getProjectContextGroup').returns('control')
216325
const editor = await toTextEditor('content-1', `file-1.${fileExt}`, tempFolder)
217326
await toTextEditor('content-2', `file-2.${fileExt}`, tempFolder, { preview: false })
218327
await toTextEditor('content-3', `file-3.${fileExt}`, tempFolder, { preview: false })

0 commit comments

Comments
 (0)