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
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 0 additions & 18 deletions packages/amazonq/.changes/1.84.0.json

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Bug Fix",
"description": "Slightly delay rendering inline completion when user is typing"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Bug Fix",
"description": "Render first response before receiving all paginated inline completion results"
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Feature",
"description": "Explain and Fix for any issue in Code Issues panel will pull the experience into chat. Also no more view details tab."
}
6 changes: 0 additions & 6 deletions packages/amazonq/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
## 1.84.0 2025-07-17

- **Bug Fix** Slightly delay rendering inline completion when user is typing
- **Bug Fix** Render first response before receiving all paginated inline completion results
- **Feature** Explain and Fix for any issue in Code Issues panel will pull the experience into chat. Also no more view details tab.

## 1.83.0 2025-07-09

- **Feature** Amazon Q /test, /doc, and /dev capabilities integrated into Agentic coding.
Expand Down
2 changes: 1 addition & 1 deletion packages/amazonq/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "amazon-q-vscode",
"displayName": "Amazon Q",
"description": "The most capable generative AI-powered assistant for building, operating, and transforming software, with advanced capabilities for managing data and AI",
"version": "1.85.0-SNAPSHOT",
"version": "1.84.0-SNAPSHOT",
"extensionKind": [
"workspace"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ export async function showEdits(
const { svgImage, startLine, newCode, origionalCodeHighlightRange } =
await svgGenerationService.generateDiffSvg(currentFile, item.insertText as string)

// TODO: To investigate why it fails and patch [generateDiffSvg]
if (newCode.length === 0) {
getLogger('nextEditPrediction').warn('not able to apply provided edit suggestion, skip rendering')
return
}

if (svgImage) {
// display the SVG image
await displaySvgDecoration(
Expand Down
15 changes: 7 additions & 8 deletions packages/amazonq/src/app/inline/completion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,6 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
return []
}

const isAutoTrigger = context.triggerKind === InlineCompletionTriggerKind.Automatic
if (isAutoTrigger && !CodeSuggestionsState.instance.isSuggestionsEnabled()) {
// return early when suggestions are disabled with auto trigger
return []
}

// yield event loop to let the document listen catch updates
await sleep(1)
// prevent user deletion invoking auto trigger
Expand All @@ -260,6 +254,12 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
try {
const t0 = performance.now()
vsCodeState.isRecommendationsActive = true
const isAutoTrigger = context.triggerKind === InlineCompletionTriggerKind.Automatic
if (isAutoTrigger && !CodeSuggestionsState.instance.isSuggestionsEnabled()) {
// return early when suggestions are disabled with auto trigger
return []
}

// handling previous session
const prevSession = this.sessionManager.getActiveSession()
const prevSessionId = prevSession?.sessionId
Expand Down Expand Up @@ -335,8 +335,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
context,
token,
isAutoTrigger,
getAllRecommendationsOptions,
this.documentEventListener.getLastDocumentChangeEvent(document.uri.fsPath)?.event
getAllRecommendationsOptions
)
// get active item from session for displaying
const items = this.sessionManager.getActiveRecommendation()
Expand Down
19 changes: 0 additions & 19 deletions packages/amazonq/src/app/inline/documentEventListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ export class DocumentEventListener {
this.lastDocumentChangeEventMap.clear()
}
this.lastDocumentChangeEventMap.set(e.document.uri.fsPath, { event: e, timestamp: performance.now() })
// The VS Code provideInlineCompletionCallback may not trigger when Enter is pressed, especially in Python files
// manually make this trigger. In case of duplicate, the provideInlineCompletionCallback is already debounced
if (this.isEnter(e) && vscode.window.activeTextEditor) {
void vscode.commands.executeCommand('editor.action.inlineSuggest.trigger')
}
}
})
}
Expand All @@ -52,18 +47,4 @@ export class DocumentEventListener {
this.documentChangeListener.dispose()
}
}

private isEnter(e: vscode.TextDocumentChangeEvent): boolean {
if (e.contentChanges.length !== 1) {
return false
}
const str = e.contentChanges[0].text
if (str.length === 0) {
return false
}
return (
(str.startsWith('\r\n') && str.substring(2).trim() === '') ||
(str[0] === '\n' && str.substring(1).trim() === '')
)
}
}
15 changes: 1 addition & 14 deletions packages/amazonq/src/app/inline/recommendationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import * as vscode from 'vscode'
import {
InlineCompletionListWithReferences,
InlineCompletionWithReferencesParams,
inlineCompletionWithReferencesRequestType,
TextDocumentContentChangeEvent,
} from '@aws/language-server-runtimes/protocol'
import { CancellationToken, InlineCompletionContext, Position, TextDocument } from 'vscode'
import { LanguageClient } from 'vscode-languageclient'
Expand Down Expand Up @@ -42,28 +40,17 @@ export class RecommendationService {
context: InlineCompletionContext,
token: CancellationToken,
isAutoTrigger: boolean,
options: GetAllRecommendationsOptions = { emitTelemetry: true, showUi: true },
documentChangeEvent?: vscode.TextDocumentChangeEvent
options: GetAllRecommendationsOptions = { emitTelemetry: true, showUi: true }
) {
// Record that a regular request is being made
this.cursorUpdateRecorder?.recordCompletionRequest()
const documentChangeParams = documentChangeEvent
? {
textDocument: {
uri: document.uri.toString(),
version: document.version,
},
contentChanges: documentChangeEvent.contentChanges.map((x) => x as TextDocumentContentChangeEvent),
}
: undefined

let request: InlineCompletionWithReferencesParams = {
textDocument: {
uri: document.uri.toString(),
},
position,
context,
documentChangeParams: documentChangeParams,
}
if (options.editsStreakToken) {
request = { ...request, partialResultToken: options.editsStreakToken }
Expand Down
25 changes: 12 additions & 13 deletions packages/amazonq/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { AuthUtils, CredentialsStore, LoginManager, initializeAuth } from 'aws-core-vscode/auth'
import { Auth, AuthUtils, CredentialsStore, LoginManager, initializeAuth } from 'aws-core-vscode/auth'
import { activate as activateCodeWhisperer, shutdown as shutdownCodeWhisperer } from 'aws-core-vscode/codewhisperer'
import { makeEndpointsProvider, registerGenericCommands } from 'aws-core-vscode'
import { CommonAuthWebview } from 'aws-core-vscode/login'
Expand Down Expand Up @@ -44,8 +44,8 @@ import * as vscode from 'vscode'
import { registerCommands } from './commands'
import { focusAmazonQPanel } from 'aws-core-vscode/codewhispererChat'
import { activate as activateAmazonqLsp } from './lsp/activation'
import { activate as activateInlineCompletion } from './app/inline/activation'
import { hasGlibcPatch } from './lsp/client'
import { RotatingLogChannel } from './lsp/rotatingLogChannel'

export const amazonQContextPrefix = 'amazonq'

Expand Down Expand Up @@ -104,12 +104,7 @@ export async function activateAmazonQCommon(context: vscode.ExtensionContext, is
globals.manifestPaths.endpoints = context.asAbsolutePath(join('resources', 'endpoints.json'))
globals.regionProvider = RegionProvider.fromEndpointsProvider(makeEndpointsProvider())

// Create rotating log channel for all Amazon Q logs
const qLogChannel = new RotatingLogChannel(
'Amazon Q Logs',
context,
vscode.window.createOutputChannel('Amazon Q Logs', { log: true })
)
const qLogChannel = vscode.window.createOutputChannel('Amazon Q Logs', { log: true })
await activateLogger(context, amazonQContextPrefix, qLogChannel)
globals.logOutputChannel = qLogChannel
globals.loginManager = new LoginManager(globals.awsContext, new CredentialsStore())
Expand All @@ -118,8 +113,6 @@ export async function activateAmazonQCommon(context: vscode.ExtensionContext, is
getLogger().error('fs.init: invalid env vars found: %O', homeDirLogs)
}

getLogger().info('Rotating logger has been setup')

await activateTelemetry(context, globals.awsContext, Settings.instance, 'Amazon Q For VS Code')

await initializeAuth(globals.loginManager)
Expand All @@ -133,11 +126,17 @@ export async function activateAmazonQCommon(context: vscode.ExtensionContext, is

// This contains every lsp agnostic things (auth, security scan, code scan)
await activateCodeWhisperer(extContext as ExtContext)

if (!isAmazonLinux2() || hasGlibcPatch()) {
// Activate Amazon Q LSP for everyone unless they're using AL2 without the glibc patch
if (
(Experiments.instance.get('amazonqLSP', true) || Auth.instance.isInternalAmazonUser()) &&
(!isAmazonLinux2() || hasGlibcPatch())
) {
// start the Amazon Q LSP for internal users first
// for AL2, start LSP if glibc patch is found
await activateAmazonqLsp(context)
}
if (!Experiments.instance.get('amazonqLSPInline', true)) {
await activateInlineCompletion()
}

// Generic extension commands
registerGenericCommands(context, amazonQContextPrefix)
Expand Down
17 changes: 4 additions & 13 deletions packages/amazonq/src/lsp/chat/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ import { decryptResponse, encryptRequest } from '../encryption'
import { getCursorState } from '../utils'
import { focusAmazonQPanel } from './commands'
import { ChatMessage } from '@aws/language-server-runtimes/server-interface'
import { CommentUtils } from 'aws-core-vscode/utils'

export function registerActiveEditorChangeListener(languageClient: LanguageClient) {
let debounceTimer: NodeJS.Timeout | undefined
Expand Down Expand Up @@ -702,7 +701,7 @@ async function handleCompleteResult<T extends ChatResult>(
) {
const decryptedMessage = await decryptResponse<T>(result, encryptionKey)

await handleSecurityFindings(decryptedMessage, languageClient)
handleSecurityFindings(decryptedMessage, languageClient)

void provider.webview?.postMessage({
command: chatRequestType.method,
Expand All @@ -717,10 +716,10 @@ async function handleCompleteResult<T extends ChatResult>(
disposable.dispose()
}

async function handleSecurityFindings(
function handleSecurityFindings(
decryptedMessage: { additionalMessages?: ChatMessage[] },
languageClient: LanguageClient
): Promise<void> {
): void {
if (decryptedMessage.additionalMessages === undefined || decryptedMessage.additionalMessages.length === 0) {
return
}
Expand All @@ -731,18 +730,10 @@ async function handleSecurityFindings(
try {
const aggregatedCodeScanIssues: AggregatedCodeScanIssue[] = JSON.parse(message.body)
for (const aggregatedCodeScanIssue of aggregatedCodeScanIssues) {
const document = await vscode.workspace.openTextDocument(aggregatedCodeScanIssue.filePath)
for (const issue of aggregatedCodeScanIssue.issues) {
const isIssueTitleIgnored = CodeWhispererSettings.instance
issue.visible = !CodeWhispererSettings.instance
.getIgnoredSecurityIssues()
.includes(issue.title)
const isSingleIssueIgnored = CommentUtils.detectCommentAboveLine(
document,
issue.startLine,
CodeWhispererConstants.amazonqIgnoreNextLine
)

issue.visible = !isIssueTitleIgnored && !isSingleIssueIgnored
}
}
initSecurityScanRender(aggregatedCodeScanIssues, undefined, CodeAnalysisScope.PROJECT)
Expand Down
Loading
Loading