Skip to content

Commit 9583ca7

Browse files
committed
merge: resolve import conflicts
2 parents 701617b + 2008dbd commit 9583ca7

27 files changed

+426
-101
lines changed

CONTRIBUTING.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -368,31 +368,28 @@ The `aws.dev.forceDevMode` setting enables or disables Toolkit "dev mode". Witho
368368
```
369369
tail -F ~/awstoolkit.log
370370
```
371-
- Use the `AWS (Developer): Watch Logs` command to watch and filter Toolkit logs (including
372-
telemetry) in VSCode.
373-
- Only available if you enabled "dev mode" (`aws.dev.forceDevMode` setting, see above).
374-
- Enter text in the Debug Console filter box to show only log messages with that text. <br/>
375-
<img src="./docs/images/debug-console-filter.png" alt="VSCode Debug Console" width="320"/>
371+
- Use the Output panel to watch and filter Toolkit logs (including telemetry) in VSCode.
372+
- Enter text in the Output panel filter box to show only log messages with that text.
376373
377374
#### Enabling Debug Logs
378375
379376
How to enable more detailed debug logs in the extensions.
380377
If you need to report an issue attach these to give the most detailed information.
381378
382-
1. Open the Command Palette (`cmd/ctrl` + `shift` + `p`), then search for "View Logs". Choose the correct option for the extension you want, eg: `AWS: View Logs` or `Amazon Q: View Logs`
383-
![](./docs/images/logsView.png)
379+
1. Open the Command Palette (`cmd/ctrl` + `shift` + `p`), then search for "View Logs". Choose either `AWS: View Logs` or `Amazon Q: View Logs`.
380+
- ![](./docs/images/logsView.png)
384381
2. Click the gear icon on the bottom right and select `Debug`
385-
![](./docs/images/logsSetDebug.png)
382+
- ![](./docs/images/logsSetDebug.png)
386383
3. Click the gear icon again and select `Set As Default`. This will ensure we stay in `Debug` until explicitly changed
387-
![](./docs/images/logsSetDefault.png)
384+
- ![](./docs/images/logsSetDefault.png)
388385
4. Open the Command Palette again and select `Reload Window`.
389386
5. Now you should see additional `[debug]` prefixed logs in the output.
390-
![](./docs/images/logsDebugLog.png)
387+
- ![](./docs/images/logsDebugLog.png)
391388
392389
### Telemetry
393390
394391
- See [docs/telemetry.md](./docs/telemetry.md) for guidelines on developing telemetry in this project.
395-
- To watch Toolkit telemetry events, use the `AWS (Developer): Watch Logs` command (see [Logging](#logging) above) and enter "telemetry" in the Debug Console filter box.
392+
- To watch Toolkit telemetry events, use the `Amazon Q: View Logs` command (see [Logging](#logging) above) and enter "telemetry" in the filter box.
396393
397394
### Service Endpoints
398395
-22.9 KB
Binary file not shown.
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": "`Send to prompt` and other context menu options not sent if chat was closed"
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": "Amazon Q /dev: support `.hbs`, `.gjs`, `.gts`, `.astro`, `.mdx`, `.svelte`, `.erb`, `.rake` files"
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": "/transform: automatically download results when ready"
4+
}

packages/amazonq/src/lsp/client.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { registerInlineCompletion } from '../app/inline/completion'
1111
import { AmazonQLspAuth, encryptionKey, notificationTypes } from './auth'
1212
import { AuthUtil } from 'aws-core-vscode/codewhisperer'
1313
import { ConnectionMetadata } from '@aws/language-server-runtimes/protocol'
14-
import { ResourcePaths, createServerOptions } from 'aws-core-vscode/shared'
14+
import { ResourcePaths, Settings, createServerOptions, globals } from 'aws-core-vscode/shared'
1515

1616
const localize = nls.loadMessageBundle()
1717

@@ -35,6 +35,9 @@ export async function startLanguageServer(extensionContext: vscode.ExtensionCont
3535

3636
const documentSelector = [{ scheme: 'file', language: '*' }]
3737

38+
const clientId = 'amazonq'
39+
const traceServerEnabled = Settings.instance.isSet(`${clientId}.trace.server`)
40+
3841
// Options to control the language client
3942
const clientOptions: LanguageClientOptions = {
4043
// Register the server for json documents
@@ -60,10 +63,20 @@ export async function startLanguageServer(extensionContext: vscode.ExtensionCont
6063
providesBearerToken: true,
6164
},
6265
},
66+
/**
67+
* When the trace server is enabled it outputs a ton of log messages so:
68+
* When trace server is enabled, logs go to a seperate "Amazon Q Language Server" output.
69+
* Otherwise, logs go to the regular "Amazon Q Logs" channel.
70+
*/
71+
...(traceServerEnabled
72+
? {}
73+
: {
74+
outputChannel: globals.logOutputChannel,
75+
}),
6376
}
6477

6578
const client = new LanguageClient(
66-
'amazonq',
79+
clientId,
6780
localize('amazonq.server.name', 'Amazon Q Language Server'),
6881
serverOptions,
6982
clientOptions

packages/amazonq/src/lsp/lspInstaller.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55

66
import * as vscode from 'vscode'
7-
import { Range } from 'semver'
87
import {
98
ManifestResolver,
109
LanguageServerResolver,
@@ -16,9 +15,12 @@ import {
1615
getLogger,
1716
} from 'aws-core-vscode/shared'
1817
import path from 'path'
18+
import { Range } from 'semver'
1919

20-
const manifestURL = 'https://aws-toolkit-language-servers.amazonaws.com/codewhisperer/0/manifest.json'
21-
export const supportedLspServerVersions = '^3.1.1'
20+
export const manifestURL = 'https://aws-toolkit-language-servers.amazonaws.com/codewhisperer/0/manifest.json'
21+
export const supportedLspServerVersions = new Range('^3.1.1', {
22+
includePrerelease: true,
23+
})
2224
const logger = getLogger('amazonqLsp')
2325

2426
export class AmazonQLSPResolver implements LspResolver {
@@ -44,7 +46,7 @@ export class AmazonQLSPResolver implements LspResolver {
4446
const installationResult = await new LanguageServerResolver(
4547
manifest,
4648
name,
47-
new Range(supportedLspServerVersions)
49+
supportedLspServerVersions
4850
).resolve()
4951

5052
const nodePath = path.join(installationResult.assetDirectory, `servers/${getNodeExecutableName()}`)

packages/amazonq/test/e2e/amazonq/featureDev.test.ts

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,18 @@ import sinon from 'sinon'
99
import { registerAuthHook, using } from 'aws-core-vscode/test'
1010
import { loginToIdC } from './utils/setup'
1111
import { Messenger } from './framework/messenger'
12-
import { examples } from 'aws-core-vscode/amazonqFeatureDev'
1312
import { FollowUpTypes } from 'aws-core-vscode/amazonq'
1413
import { sleep } from 'aws-core-vscode/shared'
1514

1615
describe('Amazon Q Feature Dev', function () {
1716
let framework: qTestingFramework
1817
let tab: Messenger
1918

20-
const prompt = 'Add blank.txt file with empty content'
21-
const codegenApproachPrompt = `${prompt} and add a readme that describes the changes`
22-
const fileLevelAcceptPrompt = `${prompt} and add a license, and a contributing file`
19+
const prompt = 'Add current timestamp into blank.txt'
20+
const iteratePrompt = `Add a new section in readme to explain your change`
21+
const fileLevelAcceptPrompt = `${prompt} and ${iteratePrompt}`
22+
const informationCard =
23+
'After you provide a task, I will:\n1. Generate code based on your description and the code in your workspace\n2. Provide a list of suggestions for you to review and add to your workspace\n3. If needed, iterate based on your feedback\nTo learn more, visit the [user guide](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/software-dev.html)'
2324
const tooManyRequestsWaitTime = 100000
2425

2526
async function waitForText(text: string) {
@@ -144,34 +145,35 @@ describe('Amazon Q Feature Dev', function () {
144145
})
145146

146147
describe('/dev entry', () => {
147-
it('Clicks examples', async () => {
148-
const q = framework.createTab()
149-
q.addChatMessage({ command: '/dev' })
148+
before(async () => {
149+
tab = framework.createTab()
150+
tab.addChatMessage({ command: '/dev' }) // This would create a new tab for feature dev.
151+
tab = framework.getSelectedTab()
152+
})
153+
154+
it('should display information card', async () => {
150155
await retryIfRequired(
151156
async () => {
152-
await q.waitForChatFinishesLoading()
157+
await tab.waitForChatFinishesLoading()
153158
},
154159
() => {
155-
q.clickButton(FollowUpTypes.DevExamples)
156-
157-
const lastChatItems = q.getChatItems().pop()
158-
assert.deepStrictEqual(lastChatItems?.body, examples)
160+
const lastChatItems = tab.getChatItems().pop()
161+
assert.deepStrictEqual(lastChatItems?.body, informationCard)
159162
}
160163
)
161164
})
162165
})
163166

164-
// Disable failing tests while investigation. The tests are only failing in CI environments.
165-
describe.skip('/dev {msg} entry', async () => {
167+
describe('/dev {msg} entry', async () => {
166168
beforeEach(async function () {
169+
tab = framework.createTab()
167170
tab.addChatMessage({ command: '/dev', prompt })
171+
tab = framework.getSelectedTab()
168172
await retryIfRequired(
169173
async () => {
170174
await tab.waitForChatFinishesLoading()
171175
},
172-
() => {
173-
tab.addChatMessage({ prompt })
174-
}
176+
() => {}
175177
)
176178
})
177179

@@ -211,15 +213,17 @@ describe('Amazon Q Feature Dev', function () {
211213
})
212214
tab.clickButton(FollowUpTypes.ProvideFeedbackAndRegenerateCode)
213215
await tab.waitForChatFinishesLoading()
214-
await iterate(codegenApproachPrompt)
216+
await iterate(iteratePrompt)
215217
tab.clickButton(FollowUpTypes.InsertCode)
216218
await tab.waitForButtons([FollowUpTypes.NewTask, FollowUpTypes.CloseSession])
217219
})
218220
})
219221

220-
describe.skip('file-level accepts', async () => {
222+
describe('file-level accepts', async () => {
221223
beforeEach(async function () {
224+
tab = framework.createTab()
222225
tab.addChatMessage({ command: '/dev', prompt: fileLevelAcceptPrompt })
226+
tab = framework.getSelectedTab()
223227
await retryIfRequired(
224228
async () => {
225229
await tab.waitForChatFinishesLoading()

packages/amazonq/test/e2e/amazonq/framework/framework.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,16 @@ export class qTestingFramework {
105105
return Object.entries(tabs).map(([tabId]) => new Messenger(tabId, this.mynahUIProps, this.mynahUI))
106106
}
107107

108+
public getSelectedTab() {
109+
const selectedTabId = this.mynahUI.getSelectedTabId()
110+
const selectedTab = this.getTabs().find((tab) => tab.tabID === selectedTabId)
111+
112+
if (!selectedTab) {
113+
assert.fail('Selected tab not found')
114+
}
115+
return selectedTab
116+
}
117+
108118
public findTab(title: string) {
109119
return Object.values(this.getTabs()).find((tab) => tab.getStore().tabTitle === title)
110120
}

0 commit comments

Comments
 (0)