Skip to content

Commit d922357

Browse files
committed
Merge branch 'master' into fsRefactor
2 parents 8263789 + 401fc1e commit d922357

File tree

19 files changed

+164
-81
lines changed

19 files changed

+164
-81
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
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": "Amazon Q extension may fail to start if AWS Toolkit extension fails to start"
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Removal",
3+
"description": "Minimum required VSCode version is now 1.83"
4+
}

packages/amazonq/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,6 @@
10461046
},
10471047
"engines": {
10481048
"npm": "^10.1.0",
1049-
"vscode": "^1.68.0"
1049+
"vscode": "^1.83.0"
10501050
}
10511051
}

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "Apache-2.0",
66
"engines": {
77
"npm": "^10.1.0",
8-
"vscode": "^1.68.0"
8+
"vscode": "^1.83.0"
99
},
1010
"exports": {
1111
".": "./dist/src/extension.js",

packages/core/src/amazonq/lsp/lspController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
import * as vscode from 'vscode'
77
import * as path from 'path'
8-
import { createWriteStream } from 'fs'
98
import * as crypto from 'crypto'
9+
import { createWriteStream } from 'fs'
1010
import { getLogger } from '../../shared/logger/logger'
1111
import { CurrentWsFolders, collectFilesForIndex } from '../../shared/utilities/workspaceUtils'
1212
import fetch from 'node-fetch'

packages/core/src/codewhisperer/commands/basicCommands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ export const registerToolkitApiCallback = Commands.declare(
462462
} else if (isExtensionActive(VSCODE_EXTENSION_ID.awstoolkit)) {
463463
// when this command is executed by Amazon Q activation
464464
const toolkitExt = vscode.extensions.getExtension(VSCODE_EXTENSION_ID.awstoolkit)
465-
_toolkitApi = toolkitExt?.exports.getApi(VSCODE_EXTENSION_ID.amazonq)
465+
_toolkitApi = toolkitExt?.exports?.getApi(VSCODE_EXTENSION_ID.amazonq)
466466
}
467467
if (_toolkitApi) {
468468
registerToolkitApiCallbackOnce()

packages/core/src/codewhispererChat/controllers/chat/messenger/messenger.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,22 @@ export class Messenger {
9191
)
9292
)
9393
}
94-
94+
/**
95+
* Tries to calculate the total number of code blocks.
96+
* NOTES:
97+
* - Not correct on all examples. Some may cause it to return 0 unexpectedly.
98+
* - Plans in place (as of 4/22/2024) to move this server side.
99+
* - See original pr: https://github.com/aws/aws-toolkit-vscode/pull/4761 for more details.
100+
* @param message raw message response from codewhisperer client.
101+
* @returns count of multi-line code blocks in response.
102+
*/
95103
public async countTotalNumberOfCodeBlocks(message: string): Promise<number> {
104+
//TODO: remove this when moved to server-side.
96105
if (message === undefined) {
97106
return 0
98107
}
99108

100-
// // To Convert Markdown text to HTML using marked library
109+
// To Convert Markdown text to HTML using marked library
101110
const html = await marked(message)
102111

103112
const dom = new JSDOM(html)

packages/core/src/lambda/commands/uploadLambda.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import AdmZip from 'adm-zip'
1212
import * as path from 'path'
1313
import { fs } from '../../shared'
1414
import { showConfirmationMessage, showViewLogsMessage } from '../../shared/utilities/messages'
15-
import { cloud9Findfile, makeTemporaryToolkitFolder, tryRemoveFolder } from '../../shared/filesystemUtilities'
15+
import { makeTemporaryToolkitFolder, tryRemoveFolder } from '../../shared/filesystemUtilities'
1616
import * as localizedText from '../../shared/localizedText'
1717
import { getLogger } from '../../shared/logger'
1818
import { SamCliBuildInvocation } from '../../shared/sam/cli/samCliBuild'
@@ -494,17 +494,15 @@ export async function findApplicationJsonFile(
494494
}
495495
const isdir = await fs.existsDir(startPath.fsPath)
496496
const parentDir = isdir ? startPath.fsPath : path.dirname(startPath.fsPath)
497-
const found = cloud9
498-
? await cloud9Findfile(parentDir, '.application.json')
499-
: await vscode.workspace.findFiles(
500-
new vscode.RelativePattern(parentDir, '**/.application.json'),
501-
// exclude:
502-
// - null = NO excludes apply
503-
// - undefined = default excludes apply (e.g. the `files.exclude` setting but not `search.exclude`).
504-
// eslint-disable-next-line unicorn/no-null
505-
null,
506-
1
507-
)
497+
const found = await vscode.workspace.findFiles(
498+
new vscode.RelativePattern(parentDir, '**/.application.json'),
499+
// exclude:
500+
// - null = NO excludes apply
501+
// - undefined = default excludes apply (e.g. the `files.exclude` setting but not `search.exclude`).
502+
// eslint-disable-next-line unicorn/no-null
503+
null,
504+
1
505+
)
508506
if (!found || found.length === 0) {
509507
getLogger().debug('uploadLambda: .application.json not found in: "%s"', parentDir)
510508
}

packages/core/src/login/webview/vue/amazonq/backend_amazonq.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class AmazonQLoginWebview extends CommonAuthWebview {
4545
}
4646
await activateExtension(VSCODE_EXTENSION_ID.awstoolkit)
4747
const toolkitExt = vscode.extensions.getExtension(VSCODE_EXTENSION_ID.awstoolkit)
48-
const importedApi = toolkitExt?.exports.getApi(VSCODE_EXTENSION_ID.amazonq)
48+
const importedApi = toolkitExt?.exports?.getApi(VSCODE_EXTENSION_ID.amazonq)
4949
if (importedApi && 'listConnections' in importedApi) {
5050
return ((await importedApi?.listConnections()) as AwsConnection[]).filter(
5151
// No need to display Builder ID as an existing connection,

0 commit comments

Comments
 (0)