Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/amazonq/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,11 @@
"when": "(view == aws.amazonq.AmazonQChatView) && aws.codewhisperer.connected && !aws.isSageMakerUnifiedStudio",
"group": "2_amazonQ@4"
},
{
"command": "aws.amazonq.showLogs",
"when": "view == aws.amazonq.AmazonQChatView",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we show this for SageMakerUnifiedStudio ?

"group": "1_amazonQ@5"
},
{
"command": "aws.amazonq.reconnect",
"when": "(view == aws.amazonq.AmazonQChatView) && aws.codewhisperer.connectionExpired",
Expand Down Expand Up @@ -636,6 +641,12 @@
"category": "%AWS.amazonq.title%",
"enablement": "aws.codewhisperer.connected"
},
{
"command": "aws.amazonq.showLogs",
"title": "%AWS.command.codewhisperer.showLogs%",
"category": "%AWS.amazonq.title%",
"enablement": "aws.codewhisperer.connected"
},
{
"command": "aws.amazonq.selectRegionProfile",
"title": "Change Profile",
Expand Down
1 change: 1 addition & 0 deletions packages/core/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@
"AWS.command.codewhisperer.signout": "Sign Out",
"AWS.command.codewhisperer.reconnect": "Reconnect",
"AWS.command.codewhisperer.openReferencePanel": "Open Code Reference Log",
"AWS.command.codewhisperer.showLogs": "Show Logs",
"AWS.command.q.selectRegionProfile": "Select Profile",
"AWS.command.q.transform.acceptChanges": "Accept",
"AWS.command.q.transform.rejectChanges": "Reject",
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/codewhisperer/activation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
enableCodeSuggestions,
toggleCodeSuggestions,
showReferenceLog,
showLogs,
showSecurityScan,
showLearnMore,
showSsoSignIn,
Expand Down Expand Up @@ -299,6 +300,7 @@ export async function activate(context: ExtContext): Promise<void> {
),
vscode.window.registerWebviewViewProvider(ReferenceLogViewProvider.viewType, ReferenceLogViewProvider.instance),
showReferenceLog.register(),
showLogs.register(),
showExploreAgentsView.register(),
vscode.languages.registerCodeLensProvider(
[...CodeWhispererConstants.platformLanguageIds],
Expand Down
26 changes: 26 additions & 0 deletions packages/core/src/codewhisperer/commands/basicCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,32 @@ export const showReferenceLog = Commands.declare(
}
)

export const showLogs = Commands.declare(
{ id: 'aws.amazonq.showLogs', compositeKey: { 1: 'source' } },
() => async (_: VsCodeCommandArg, source: CodeWhispererSource) => {
if (_ !== placeholder) {
source = 'ellipsesMenu'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:
Whats this ellipsesMenu?

}

// Show warning message without buttons - just informational
void vscode.window.showWarningMessage(
'Log files may contain sensitive information such as account IDs, resource names, and other data. Be careful when sharing these logs.'
)

// Get the log directory path
const logFolderPath = globals.context.logUri?.fsPath
const path = require('path')
const logFilePath = path.join(logFolderPath, 'Amazon Q Logs.log')
if (logFilePath) {
// Open the log directory in the OS file explorer directly
await vscode.commands.executeCommand('revealFileInOS', vscode.Uri.file(logFilePath))
} else {
// Fallback: show error if log path is not available
void vscode.window.showErrorMessage('Log location not available.')
}
}
)

export const showExploreAgentsView = Commands.declare(
{ id: 'aws.amazonq.exploreAgents', compositeKey: { 1: 'source' } },
() => async (_: VsCodeCommandArg, source: CodeWhispererSource) => {
Expand Down
Loading