Skip to content

Commit 9003bde

Browse files
committed
merge: handle conflicts with master
2 parents f27bacb + fdaaae1 commit 9003bde

File tree

80 files changed

+2580
-513
lines changed

Some content is hidden

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

80 files changed

+2580
-513
lines changed

package-lock.json

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"date": "2025-05-01",
3+
"version": "1.63.0",
4+
"entries": [
5+
{
6+
"type": "Bug Fix",
7+
"description": "Q profile selection hangs when a region is blocked"
8+
},
9+
{
10+
"type": "Feature",
11+
"description": "Agentic coding experience: Amazon Q can now write code and run shell commands on your behalf"
12+
}
13+
]
14+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"date": "2025-05-02",
3+
"version": "1.64.0",
4+
"entries": [
5+
{
6+
"type": "Bug Fix",
7+
"description": "Enable Amazon Q LSP in AL2 instances"
8+
}
9+
]
10+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"date": "2025-05-05",
3+
"version": "1.65.0",
4+
"entries": [
5+
{
6+
"type": "Feature",
7+
"description": "Support selecting customizations across all Q profiles with automatic profile switching for enterprise users"
8+
},
9+
{
10+
"type": "Feature",
11+
"description": "Memorize and autofill users' last Sso login profile"
12+
}
13+
]
14+
}

packages/amazonq/CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
## 1.65.0 2025-05-05
2+
3+
- **Feature** Support selecting customizations across all Q profiles with automatic profile switching for enterprise users
4+
- **Feature** Memorize and autofill users' last Sso login profile
5+
6+
## 1.64.0 2025-05-02
7+
8+
- **Bug Fix** Enable Amazon Q LSP in AL2 instances
9+
10+
## 1.63.0 2025-05-01
11+
12+
- **Bug Fix** Q profile selection hangs when a region is blocked
13+
- **Feature** Agentic coding experience: Amazon Q can now write code and run shell commands on your behalf
14+
115
## 1.62.0 2025-04-25
216

317
- **Bug Fix** Toast message to warn users if Developer Profile is not selected

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": "The most capable generative AI-powered assistant for building, operating, and transforming software, with advanced capabilities for managing data and AI",
5-
"version": "1.63.0-SNAPSHOT",
5+
"version": "1.66.0-SNAPSHOT",
66
"extensionKind": [
77
"workspace"
88
],

packages/amazonq/src/app/chat/activation.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export async function activate(context: ExtensionContext) {
1818
void amazonq.LspController.instance.trySetupLsp(context, {
1919
startUrl: AuthUtil.instance.startUrl,
2020
maxIndexSize: CodeWhispererSettings.instance.getMaxIndexSize(),
21-
isVectorIndexEnabled: CodeWhispererSettings.instance.isLocalIndexEnabled(),
21+
isVectorIndexEnabled: false,
2222
})
2323
}, 5000)
2424

@@ -30,14 +30,7 @@ export async function activate(context: ExtensionContext) {
3030
amazonq.listCodeWhispererCommandsWalkthrough.register(),
3131
amazonq.focusAmazonQPanel.register(),
3232
amazonq.focusAmazonQPanelKeybinding.register(),
33-
amazonq.tryChatCodeLensCommand.register(),
34-
vscode.workspace.onDidChangeConfiguration(async (configurationChangeEvent) => {
35-
if (configurationChangeEvent.affectsConfiguration('amazonQ.workspaceIndex')) {
36-
if (CodeWhispererSettings.instance.isLocalIndexEnabled()) {
37-
void setupLsp()
38-
}
39-
}
40-
})
33+
amazonq.tryChatCodeLensCommand.register()
4134
)
4235

4336
Commands.register('aws.amazonq.learnMore', () => {

packages/amazonq/src/extension.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import {
3333
maybeShowMinVscodeWarning,
3434
Experiments,
3535
isSageMaker,
36+
isAmazonInternalOs,
3637
} from 'aws-core-vscode/shared'
3738
import { ExtStartUpSources } from 'aws-core-vscode/telemetry'
3839
import { VSCODE_EXTENSION_ID } from 'aws-core-vscode/utils'
@@ -43,7 +44,7 @@ import { registerCommands } from './commands'
4344
import { focusAmazonQPanel } from 'aws-core-vscode/codewhispererChat'
4445
import { activate as activateAmazonqLsp } from './lsp/activation'
4546
import { activate as activateInlineCompletion } from './app/inline/activation'
46-
import { isAmazonInternalOs } from 'aws-core-vscode/shared'
47+
import { hasGlibcPatch } from './lsp/client'
4748

4849
export const amazonQContextPrefix = 'amazonq'
4950

@@ -122,9 +123,10 @@ export async function activateAmazonQCommon(context: vscode.ExtensionContext, is
122123
await activateCodeWhisperer(extContext as ExtContext)
123124
if (
124125
(Experiments.instance.get('amazonqLSP', true) || Auth.instance.isInternalAmazonUser()) &&
125-
!isAmazonInternalOs()
126+
(!isAmazonInternalOs() || (await hasGlibcPatch()))
126127
) {
127128
// start the Amazon Q LSP for internal users first
129+
// for AL2, start LSP if glibc patch is found
128130
await activateAmazonqLsp(context)
129131
}
130132
if (!Experiments.instance.get('amazonqLSPInline', false)) {

packages/amazonq/src/lsp/chat/commands.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
import { Commands, globals } from 'aws-core-vscode/shared'
77
import { window } from 'vscode'
88
import { AmazonQChatViewProvider } from './webviewProvider'
9+
import { CodeScanIssue } from 'aws-core-vscode/codewhisperer'
10+
import { EditorContextExtractor } from 'aws-core-vscode/codewhispererChat'
11+
import { DefaultAmazonQAppInitContext } from 'aws-core-vscode/amazonq'
912

1013
/**
1114
* TODO: Re-enable these once we can figure out which path they're going to live in
@@ -17,6 +20,52 @@ export function registerCommands(provider: AmazonQChatViewProvider) {
1720
registerGenericCommand('aws.amazonq.refactorCode', 'Refactor', provider),
1821
registerGenericCommand('aws.amazonq.fixCode', 'Fix', provider),
1922
registerGenericCommand('aws.amazonq.optimizeCode', 'Optimize', provider),
23+
Commands.register('aws.amazonq.generateUnitTests', async () => {
24+
DefaultAmazonQAppInitContext.instance.getAppsToWebViewMessagePublisher().publish({
25+
sender: 'testChat',
26+
command: 'test',
27+
type: 'chatMessage',
28+
})
29+
}),
30+
Commands.register('aws.amazonq.explainIssue', async (issue: CodeScanIssue) => {
31+
void focusAmazonQPanel().then(async () => {
32+
const editorContextExtractor = new EditorContextExtractor()
33+
const extractedContext = await editorContextExtractor.extractContextForTrigger('ContextMenu')
34+
const selectedCode =
35+
extractedContext?.activeFileContext?.fileText
36+
?.split('\n')
37+
.slice(issue.startLine, issue.endLine)
38+
.join('\n') ?? ''
39+
40+
// The message that gets sent to the UI
41+
const uiMessage = [
42+
'Explain the ',
43+
issue.title,
44+
' issue in the following code:',
45+
'\n```\n',
46+
selectedCode,
47+
'\n```',
48+
].join('')
49+
50+
// The message that gets sent to the backend
51+
const contextMessage = `Explain the issue "${issue.title}" (${JSON.stringify(
52+
issue
53+
)}) and generate code demonstrating the fix`
54+
55+
void provider.webview?.postMessage({
56+
command: 'sendToPrompt',
57+
params: {
58+
selection: '',
59+
triggerType: 'contextMenu',
60+
prompt: {
61+
prompt: uiMessage, // what gets sent to the user
62+
escapedPrompt: contextMessage, // what gets sent to the backend
63+
},
64+
autoSubmit: true,
65+
},
66+
})
67+
})
68+
}),
2069
Commands.register('aws.amazonq.sendToPrompt', (data) => {
2170
const triggerType = getCommandTriggerType(data)
2271
const selection = getSelectedText()

packages/amazonq/src/lsp/chat/messages.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,14 @@ import * as vscode from 'vscode'
5757
import { Disposable, LanguageClient, Position, TextDocumentIdentifier } from 'vscode-languageclient'
5858
import * as jose from 'jose'
5959
import { AmazonQChatViewProvider } from './webviewProvider'
60-
import { AuthUtil } from 'aws-core-vscode/codewhisperer'
60+
import { AuthUtil, ReferenceLogViewProvider } from 'aws-core-vscode/codewhisperer'
6161
import { amazonQDiffScheme, AmazonQPromptSettings, messages, openUrl } from 'aws-core-vscode/shared'
6262
import {
6363
DefaultAmazonQAppInitContext,
6464
messageDispatcher,
6565
EditorContentController,
6666
ViewDiffMessage,
67+
referenceLogText,
6768
} from 'aws-core-vscode/amazonq'
6869
import { telemetry, TelemetryBase } from 'aws-core-vscode/telemetry'
6970
import { isValidResponseError } from './error'
@@ -537,20 +538,25 @@ async function handlePartialResult<T extends ChatResult>(
537538
* Decodes the final chat responses from the language server before sending it to mynah UI.
538539
* Once this is called the answer response is finished
539540
*/
540-
async function handleCompleteResult<T>(
541+
async function handleCompleteResult<T extends ChatResult>(
541542
result: string | T,
542543
encryptionKey: Buffer | undefined,
543544
provider: AmazonQChatViewProvider,
544545
tabId: string,
545546
disposable: Disposable
546547
) {
547548
const decryptedMessage =
548-
typeof result === 'string' && encryptionKey ? await decodeRequest(result, encryptionKey) : result
549+
typeof result === 'string' && encryptionKey ? await decodeRequest<T>(result, encryptionKey) : (result as T)
549550
void provider.webview?.postMessage({
550551
command: chatRequestType.method,
551552
params: decryptedMessage,
552553
tabId: tabId,
553554
})
555+
556+
// only add the reference log once the request is complete, otherwise we will get duplicate log items
557+
for (const ref of decryptedMessage.codeReference ?? []) {
558+
ReferenceLogViewProvider.instance.addReferenceLog(referenceLogText(ref))
559+
}
554560
disposable.dispose()
555561
}
556562

0 commit comments

Comments
 (0)