Skip to content
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9f44fa6
Release 3.60.0
May 6, 2025
8a02d60
fix(amazonq): agent tabs open with prompt options (#7265)
ctlai95 May 8, 2025
4369fb5
fix(amazonq): flare clientId changes on every instance (#7273)
jpinkney-aws May 9, 2025
0d97988
Release 1.66.0
May 9, 2025
dcaeb53
Update version to snapshot version: 3.61.0-SNAPSHOT
May 9, 2025
3290630
Merge release into master
May 9, 2025
91e5039
Update version to snapshot version: 1.67.0-SNAPSHOT
May 9, 2025
a7fd043
Merge release into master
May 9, 2025
1085a8d
telemetry(amazonq): Emit metric on server crash (#7278)
nkomonen-amazon May 9, 2025
a14b9a2
telemetry(amazonq): expose FileCreationFailed exceptions #7260
akhamis-amzn May 9, 2025
05cde57
fix(lsp): send extension version to Q LSP #7279
yueny2020 May 9, 2025
4b09167
fix(amazonq): adding logs for the agentic chat telemetry events (#7276)
laileni-aws May 9, 2025
ffc0cb4
fix(amazonq): pass uri.path as workspaceIdentifier when initializing …
LiGaCu May 12, 2025
2d898fb
deps: bump @aws-toolkits/telemetry to 1.0.318 #7290
avi-alpert May 12, 2025
8e85476
fix(amazonq): use neighbor cells as completion context in Notebook #7086
brdskggs May 13, 2025
c97740e
feat(amazonq): import userWrittenCode configuration for inline with l…
zixlin7 May 13, 2025
143e35c
fix(amazonq): push customizations on startup (#7297)
nkomonen-amazon May 13, 2025
3f5fa17
deps: bump @aws-toolkits/telemetry to 1.0.319 (#7300)
chungjac May 14, 2025
6081f89
fix(amazonq):support chat in al2 aarch64 and CDM (#7270)
leigaol May 14, 2025
229126e
docs(amazonq): How to export logs (#7308)
nkomonen-amazon May 14, 2025
04eb09a
deps: bump @aws-toolkits/telemetry to 1.0.321 #7307
laileni-aws May 14, 2025
ab781b9
Release 3.61.0
May 14, 2025
2b44176
Release 1.67.0
May 14, 2025
ae4dbcd
Update version to snapshot version: 3.62.0-SNAPSHOT
May 14, 2025
74bd712
Update version to snapshot version: 1.68.0-SNAPSHOT
May 14, 2025
1619e6b
Merge release into master
May 14, 2025
6fead6e
feat(amazonq): add inline completion support for abap language (#7303)
Will-ShaoHua May 14, 2025
6898221
fix(amazonq): Profile needing to be selected on server restart (#7316)
nkomonen-amazon May 15, 2025
327fb56
fix(chat): adding new events for list mcp server and click mcp events…
ashishrp-aws May 15, 2025
3f41b8b
Merge remote-tracking branch 'upstream/feature/amazonqLSP-auth' into …
opieter-aws May 15, 2025
87ae1f4
lintfix
opieter-aws May 15, 2025
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
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,9 @@ If you need to report an issue attach these to give the most detailed informatio
4. Open the Command Palette again and select `Reload Window`.
5. Now you should see additional `[debug]` prefixed logs in the output.
- ![](./docs/images/logsDebugLog.png)
6. To export logs, click the kebab (`...`), select `Export Logs`, and then select the appropriate channel (`Amazon Q Logs` for Amazon Q)
- ![](./docs/images/openExportLogs.png)
- ![](./docs/images/exportAmazonQLogs.png)

### Telemetry

Expand Down
Binary file added docs/images/exportAmazonQLogs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/openExportLogs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,815 changes: 361 additions & 1,454 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"skippedTestReport": "ts-node ./scripts/skippedTestReport.ts ./packages/amazonq/test/e2e/"
},
"devDependencies": {
"@aws-toolkits/telemetry": "^1.0.318",
"@aws-toolkits/telemetry": "^1.0.322",
"@playwright/browser-chromium": "^1.43.1",
"@stylistic/eslint-plugin": "^2.11.0",
"@types/he": "^1.2.3",
Expand Down
14 changes: 14 additions & 0 deletions packages/amazonq/.changes/1.67.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"date": "2025-05-14",
"version": "1.67.0",
"entries": [
{
"type": "Bug Fix",
"description": "Previous and subsequent cells are used as context for completion in a Jupyter notebook"
},
{
"type": "Bug Fix",
"description": "Support chat in AL2 aarch64"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Bug Fix",
"description": "Fix Error: 'Amazon Q service is not signed in'"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Bug Fix",
"description": "Fix Error: 'Amazon Q Profile is not selected for IDC connection type'"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Feature",
"description": "Add inline completion support for abap language"
}
5 changes: 5 additions & 0 deletions packages/amazonq/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.67.0 2025-05-14

- **Bug Fix** Previous and subsequent cells are used as context for completion in a Jupyter notebook
- **Bug Fix** Support chat in AL2 aarch64

## 1.66.0 2025-05-09

- **Bug Fix** Avoid inline completion 'Improperly formed request' errors when file is too large
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.67.0-SNAPSHOT",
"version": "1.68.0-SNAPSHOT",
"extensionKind": [
"workspace"
],
Expand Down
4 changes: 4 additions & 0 deletions packages/amazonq/src/lsp/chat/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import {
getSerializedChatRequestType,
listConversationsRequestType,
conversationClickRequestType,
listMcpServersRequestType,
mcpServerClickRequestType,
ShowSaveFileDialogRequestType,
ShowSaveFileDialogParams,
LSPErrorCodes,
Expand Down Expand Up @@ -310,6 +312,8 @@ export function registerMessageListeners(
}
case listConversationsRequestType.method:
case conversationClickRequestType.method:
case listMcpServersRequestType.method:
case mcpServerClickRequestType.method:
case tabBarActionRequestType.method:
await resolveChatResponse(message.command, message.params, languageClient, webview)
break
Expand Down
24 changes: 11 additions & 13 deletions packages/amazonq/src/lsp/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
GetConfigurationFromServerParams,
RenameFilesParams,
ResponseMessage,
updateConfigurationRequestType,
WorkspaceFolder,
GetSsoTokenProgress,
GetSsoTokenProgressToken,
Expand All @@ -31,6 +30,7 @@
ShowDocumentResult,
ResponseError,
LSPErrorCodes,
updateConfigurationRequestType,
} from '@aws/language-server-runtimes/protocol'
import { AuthUtil, CodeWhispererSettings, getSelectedCustomization } from 'aws-core-vscode/codewhisperer'
import {
Expand All @@ -43,8 +43,7 @@
getLogger,
undefinedIfEmpty,
getOptOutPreference,
isAmazonInternalOs,
fs,
isAmazonLinux2,
oidcClientName,
openUrl,
getClientId,
Expand All @@ -60,14 +59,17 @@
const localize = nls.loadMessageBundle()
const logger = getLogger('amazonqLsp.lspClient')

export const glibcLinker: string = process.env.VSCODE_SERVER_CUSTOM_GLIBC_LINKER || ''
export const glibcPath: string = process.env.VSCODE_SERVER_CUSTOM_GLIBC_PATH || ''
export function hasGlibcPatch(): boolean {
return glibcLinker.length > 0 && glibcPath.length > 0
}

export const clientId = 'amazonq'
export const clientName = oidcClientName()
export const encryptionKey = crypto.randomBytes(32)

export async function hasGlibcPatch(): Promise<boolean> {
return await fs.exists('/opt/vsc-sysroot/lib64/ld-linux-x86-64.so.2')
}

Check failure on line 72 in packages/amazonq/src/lsp/client.ts

View workflow job for this annotation

GitHub Actions / lint (18.x, stable)

Delete `⏎`
export async function startLanguageServer(
extensionContext: vscode.ExtensionContext,
resourcePaths: AmazonQResourcePaths
Expand All @@ -88,13 +90,8 @@
const traceServerEnabled = Settings.instance.isSet(`${clientId}.trace.server`)
let executable: string[] = []
// apply the GLIBC 2.28 path to node js runtime binary
if (isAmazonInternalOs() && (await hasGlibcPatch())) {
executable = [
'/opt/vsc-sysroot/lib64/ld-linux-x86-64.so.2',
'--library-path',
'/opt/vsc-sysroot/lib64',
resourcePaths.node,
]
if (isAmazonLinux2() && hasGlibcPatch()) {
executable = [glibcLinker, '--library-path', glibcPath, resourcePaths.node]
getLogger('amazonqLsp').info(`Patched node runtime with GLIBC to ${executable}`)
} else {
executable = [resourcePaths.node]
Expand Down Expand Up @@ -177,6 +174,7 @@

const disposable = client.start()
toDispose.push(disposable)
await client.onReady()

await client.onReady()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ describe('runtimeLanguageContext', function () {
'jsx',
'kotlin',
'php',
'plaintext',
'python',
'ruby',
'rust',
Expand Down Expand Up @@ -288,7 +287,6 @@ describe('runtimeLanguageContext', function () {
['jsx', 'jsx'],
['kotlin', 'kt'],
['php', 'php'],
['plaintext', 'txt'],
['python', 'py'],
['ruby', 'rb'],
['rust', 'rs'],
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,8 @@
"@aws-sdk/types": "^3.13.1",
"@aws/chat-client": "^0.1.4",
"@aws/chat-client-ui-types": "^0.1.24",
"@aws/language-server-runtimes": "^0.2.70",
"@aws/language-server-runtimes-types": "^0.1.26",
"@aws/language-server-runtimes": "^0.2.81",
"@aws/language-server-runtimes-types": "^0.1.28",
"@cspotcode/source-map-support": "^0.8.1",
"@sinonjs/fake-timers": "^10.0.2",
"@types/adm-zip": "^0.4.34",
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/amazonq/lsp/lspController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { activate as activateLsp, LspClient } from './lspClient'
import { telemetry } from '../../shared/telemetry/telemetry'
import { isCloud9 } from '../../shared/extensionUtilities'
import globals, { isWeb } from '../../shared/extensionGlobals'
import { isAmazonInternalOs } from '../../shared/vscode/env'
import { isAmazonLinux2 } from '../../shared/vscode/env'
import { WorkspaceLspInstaller } from './workspaceInstaller'
import { lspSetupStage } from '../../shared/lsp/utils/setupStage'
import { RelevantTextDocumentAddition } from '../../codewhispererChat/controllers/chat/model'
Expand Down Expand Up @@ -165,7 +165,7 @@ export class LspController {
}

async trySetupLsp(context: vscode.ExtensionContext, buildIndexConfig: BuildIndexConfig) {
if (isCloud9() || isWeb() || isAmazonInternalOs()) {
if (isCloud9() || isWeb() || isAmazonLinux2()) {
this.logger.warn('Skipping LSP setup. LSP is not compatible with the current environment. ')
// do not do anything if in Cloud9 or Web mode or in AL2 (AL2 does not support node v18+)
return
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export {
isBuilderIdConnection,
getTelemetryMetadataForConn,
isIamConnection,
isSsoConnection,
} from './connection'
export { Auth } from './auth'
export { CredentialsStore } from './credentials/store'
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/codewhisperer/util/editorContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ export function extractContextForCodeWhisperer(editor: vscode.TextEditor): codew
)
let languageName = 'plaintext'
if (!checkLeftContextKeywordsForJson(document.fileName, caretLeftFileContext, editor.document.languageId)) {
languageName =
runtimeLanguageContext.normalizeLanguage(editor.document.languageId) ?? editor.document.languageId
languageName = runtimeLanguageContext.resolveLang(editor.document)
}
if (editor.document.uri.scheme === 'vscode-notebook-cell') {
const notebook = getEnclosingNotebook(editor)
Expand Down
25 changes: 21 additions & 4 deletions packages/core/src/codewhisperer/util/runtimeLanguageContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class RuntimeLanguageContext {

constructor() {
this.supportedLanguageMap = createConstantMap<
CodeWhispererConstants.PlatformLanguageId | CodewhispererLanguage,
Exclude<CodeWhispererConstants.PlatformLanguageId | CodewhispererLanguage, 'plaintext'>,
CodewhispererLanguage
>({
c: 'c',
Expand All @@ -85,7 +85,6 @@ export class RuntimeLanguageContext {
jsx: 'jsx',
kotlin: 'kotlin',
packer: 'tf',
plaintext: 'plaintext',
php: 'php',
python: 'python',
ruby: 'ruby',
Expand All @@ -112,6 +111,7 @@ export class RuntimeLanguageContext {
systemverilog: 'systemVerilog',
verilog: 'systemVerilog',
vue: 'vue',
abap: 'abap',
})
this.supportedLanguageExtensionMap = createConstantMap<string, CodewhispererLanguage>({
c: 'c',
Expand Down Expand Up @@ -152,6 +152,8 @@ export class RuntimeLanguageContext {
ps1: 'powershell',
psm1: 'powershell',
r: 'r',
abap: 'abap',
acds: 'abap',
})
this.languageSingleLineCommentPrefixMap = createConstantMap<CodewhispererLanguage, string>({
c: '// ',
Expand Down Expand Up @@ -185,9 +187,14 @@ export class RuntimeLanguageContext {
vue: '', // vue lacks a single-line comment prefix
yaml: '# ',
yml: '# ',
abap: '',
})
}

public resolveLang(doc: vscode.TextDocument): CodewhispererLanguage {
return this.normalizeLanguage(doc.languageId) || this.byFileExt(doc) || 'plaintext'
}

/**
* To add a new platform language id:
* 1. add new platform language ID constant in the file codewhisperer/constant.ts
Expand Down Expand Up @@ -317,8 +324,7 @@ export class RuntimeLanguageContext {
} else {
const normalizedLanguageId = this.normalizeLanguage(arg.languageId)
const byLanguageId = !normalizedLanguageId || normalizedLanguageId === 'plaintext' ? false : true
const extension = path.extname(arg.uri.fsPath)
const byFileExtension = this.isFileFormatSupported(extension.substring(1))
const byFileExtension = this.byFileExt(arg) !== undefined

return byLanguageId || byFileExtension
}
Expand All @@ -341,6 +347,17 @@ export class RuntimeLanguageContext {
public getLanguageFromFileExtension(fileExtension: string) {
return this.supportedLanguageExtensionMap.get(fileExtension)
}

private byFileExt(doc: vscode.TextDocument): CodewhispererLanguage | undefined {
const extension = path.extname(doc.uri.fsPath)
const byExt = this.supportedLanguageExtensionMap.get(extension.substring(1))

if (byExt === 'plaintext') {
return undefined
}

return byExt
}
}

export const runtimeLanguageContext = new RuntimeLanguageContext()
2 changes: 1 addition & 1 deletion packages/core/src/shared/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export * from './extensionUtilities'
export * from './extensionStartup'
export { RegionProvider } from './regions/regionProvider'
export { Commands } from './vscode/commands2'
export { getMachineId, getServiceEnvVarConfig, isAmazonInternalOs } from './vscode/env'
export { getMachineId, getServiceEnvVarConfig, isAmazonLinux2 } from './vscode/env'
export { getLogger } from './logger/logger'
export { activateExtension, openUrl } from './utilities/vsCodeUtils'
export { waitUntil, sleep, Timeout } from './utilities/timeoutUtils'
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/shared/telemetry/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
isAutomation,
isRemoteWorkspace,
isCloudDesktop,
isAmazonInternalOs,
isAmazonLinux2,
} from '../vscode/env'
import { addTypeName } from '../utilities/typeConstructors'
import globals, { isWeb } from '../extensionGlobals'
Expand Down Expand Up @@ -290,7 +290,7 @@ export async function getComputeEnvType(): Promise<EnvType> {
} else if (isSageMaker()) {
return web ? 'sagemaker-web' : 'sagemaker'
} else if (isRemoteWorkspace()) {
if (isAmazonInternalOs()) {
if (isAmazonLinux2()) {
if (await isCloudDesktop()) {
return 'cloudDesktop-amzn'
}
Expand Down
14 changes: 6 additions & 8 deletions packages/core/src/shared/vscode/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,23 +125,21 @@ export function isRemoteWorkspace(): boolean {
}

/**
* There is Amazon Linux 2, but additionally an Amazon Linux 2 Internal.
* The internal version is for Amazon employees only. And this version can
* be used by either EC2 OR CloudDesktop. It is not exclusive to either.
* There is Amazon Linux 2.
*
* Use {@link isCloudDesktop()} to know if we are specifically using it.
* Use {@link isCloudDesktop()} to know if we are specifically using internal Amazon Linux 2.
*
* Example: `5.10.220-188.869.amzn2int.x86_64`
* Example: `5.10.220-188.869.amzn2int.x86_64` or `5.10.236-227.928.amzn2.x86_64` (Cloud Dev Machine)
*/
export function isAmazonInternalOs() {
return os.release().includes('amzn2int') && process.platform === 'linux'
export function isAmazonLinux2() {
return (os.release().includes('.amzn2int.') || os.release().includes('.amzn2.')) && process.platform === 'linux'
}

/**
* Returns true if we are in an internal Amazon Cloud Desktop
*/
export async function isCloudDesktop() {
if (!isAmazonInternalOs()) {
if (!isAmazonLinux2()) {
return false
}

Expand Down
17 changes: 7 additions & 10 deletions packages/core/src/test/shared/vscode/env.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@

import assert from 'assert'
import path from 'path'
import {
isCloudDesktop,
getEnvVars,
getServiceEnvVarConfig,
isAmazonInternalOs as isAmazonInternalOS,
isBeta,
} from '../../../shared/vscode/env'
import { isCloudDesktop, getEnvVars, getServiceEnvVarConfig, isAmazonLinux2, isBeta } from '../../../shared/vscode/env'
import { ChildProcess } from '../../../shared/utilities/processUtils'
import * as sinon from 'sinon'
import os from 'os'
Expand Down Expand Up @@ -103,13 +97,16 @@ describe('env', function () {
assert.strictEqual(isBeta(), expected)
})

it('isAmazonInternalOS', function () {
it('isAmazonLinux2', function () {
sandbox.stub(process, 'platform').value('linux')
const versionStub = stubOsVersion('5.10.220-188.869.amzn2int.x86_64')
assert.strictEqual(isAmazonInternalOS(), true)
assert.strictEqual(isAmazonLinux2(), true)

versionStub.returns('5.10.236-227.928.amzn2.x86_64')
assert.strictEqual(isAmazonLinux2(), true)

versionStub.returns('5.10.220-188.869.NOT_INTERNAL.x86_64')
assert.strictEqual(isAmazonInternalOS(), false)
assert.strictEqual(isAmazonLinux2(), false)
})

it('isCloudDesktop', async function () {
Expand Down
5 changes: 5 additions & 0 deletions packages/toolkit/.changes/3.61.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"date": "2025-05-14",
"version": "3.61.0",
"entries": []
}
Loading
Loading