diff --git a/.changes/next-release/Deprecation-a9089a93-8d74-482d-ad05-a7e160e8f646.json b/.changes/next-release/Deprecation-a9089a93-8d74-482d-ad05-a7e160e8f646.json new file mode 100644 index 00000000000..e0efb6b7897 --- /dev/null +++ b/.changes/next-release/Deprecation-a9089a93-8d74-482d-ad05-a7e160e8f646.json @@ -0,0 +1,4 @@ +{ + "type": "Deprecation", + "description": "Minimum required VS Code version is now 1.83" +} diff --git a/package-lock.json b/package-lock.json index 82232bc909e..a81a229ebec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19707,7 +19707,7 @@ }, "engines": { "npm": "^10.1.0", - "vscode": "^1.68.0" + "vscode": "^1.83.0" } }, "packages/core/node_modules/@types/node": { diff --git a/packages/core/package.json b/packages/core/package.json index d5ff2c9c011..591a40a8cea 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -9,7 +9,7 @@ "license": "Apache-2.0", "engines": { "npm": "^10.1.0", - "vscode": "^1.68.0" + "vscode": "^1.83.0" }, "activationEvents": [ "onStartupFinished", diff --git a/packages/core/src/lambda/commands/uploadLambda.ts b/packages/core/src/lambda/commands/uploadLambda.ts index 4f841ba6074..40b13ed08bf 100644 --- a/packages/core/src/lambda/commands/uploadLambda.ts +++ b/packages/core/src/lambda/commands/uploadLambda.ts @@ -12,7 +12,7 @@ import AdmZip from 'adm-zip' import * as path from 'path' import { fsCommon } from '../../srcShared/fs' import { showConfirmationMessage, showViewLogsMessage } from '../../shared/utilities/messages' -import { cloud9Findfile, makeTemporaryToolkitFolder, tryRemoveFolder } from '../../shared/filesystemUtilities' +import { makeTemporaryToolkitFolder, tryRemoveFolder } from '../../shared/filesystemUtilities' import * as localizedText from '../../shared/localizedText' import { getLogger } from '../../shared/logger' import { SamCliBuildInvocation } from '../../shared/sam/cli/samCliBuild' @@ -20,7 +20,7 @@ import { getSamCliContext } from '../../shared/sam/cli/samCliContext' import { SamTemplateGenerator } from '../../shared/templates/sam/samTemplateGenerator' import { addCodiconToString } from '../../shared/utilities/textUtilities' import { getLambdaDetails, listLambdaFunctions } from '../utils' -import { getIdeProperties, isCloud9 } from '../../shared/extensionUtilities' +import { getIdeProperties } from '../../shared/extensionUtilities' import { createQuickPick, DataQuickPickItem } from '../../shared/ui/pickerPrompter' import { createCommonButtons } from '../../shared/ui/buttons' import { StepEstimator, Wizard, WIZARD_BACK } from '../../shared/wizards/wizard' @@ -478,10 +478,7 @@ async function uploadZipBuffer( ) } -export async function findApplicationJsonFile( - startPath: vscode.Uri, - cloud9 = isCloud9() -): Promise { +export async function findApplicationJsonFile(startPath: vscode.Uri): Promise { if (!(await fsCommon.exists(startPath.fsPath))) { getLogger().error( 'findApplicationJsonFile() invalid path (not accessible or does not exist): "%s"', @@ -491,17 +488,15 @@ export async function findApplicationJsonFile( } const isdir = await fsCommon.existsDir(startPath.fsPath) const parentDir = isdir ? startPath.fsPath : path.dirname(startPath.fsPath) - const found = cloud9 - ? await cloud9Findfile(parentDir, '.application.json') - : await vscode.workspace.findFiles( - new vscode.RelativePattern(parentDir, '**/.application.json'), - // exclude: - // - null = NO excludes apply - // - undefined = default excludes apply (e.g. the `files.exclude` setting but not `search.exclude`). - // eslint-disable-next-line unicorn/no-null - null, - 1 - ) + const found = await vscode.workspace.findFiles( + new vscode.RelativePattern(parentDir, '**/.application.json'), + // exclude: + // - null = NO excludes apply + // - undefined = default excludes apply (e.g. the `files.exclude` setting but not `search.exclude`). + // eslint-disable-next-line unicorn/no-null + null, + 1 + ) if (!found || found.length === 0) { getLogger().debug('uploadLambda: .application.json not found in: "%s"', parentDir) } diff --git a/packages/core/src/shared/filesystemUtilities.ts b/packages/core/src/shared/filesystemUtilities.ts index 956d26d8e0b..4b362aadab0 100644 --- a/packages/core/src/shared/filesystemUtilities.ts +++ b/packages/core/src/shared/filesystemUtilities.ts @@ -231,35 +231,6 @@ export async function hasFileWithSuffix(dir: string, suffix: string, exclude?: v return matchedFiles.length > 0 } -/** - * TEMPORARY SHIM for vscode.workspace.findFiles() on Cloud9. - * - * @param dir Directory to search - * @param fileName Name of file to locate - * @returns List of one or zero Uris (for compat with vscode.workspace.findFiles()) - */ -export async function cloud9Findfile(dir: string, fileName: string): Promise { - getLogger().debug('cloud9Findfile: %s', dir) - const files = await fsCommon.readdir(dir) - const subDirs: vscode.Uri[] = [] - for (const file of files) { - const [currentFileName] = file - const filePath = path.join(dir, currentFileName) - if (filePath === path.join(dir, fileName)) { - return [vscode.Uri.file(filePath)] - } - if (await fsCommon.existsDir(filePath)) { - subDirs.push(vscode.Uri.file(filePath)) - } - } - for (const d of subDirs) { - const found = await cloud9Findfile(d.fsPath, fileName) - if (found.length > 0) { - return found - } - } - return [] -} /** * @returns A string path to the last locally stored download location. If none, returns the users 'Downloads' directory path. */ diff --git a/packages/core/src/test/lambda/commands/uploadLambda.test.ts b/packages/core/src/test/lambda/commands/uploadLambda.test.ts index e69863ff2a4..52927421fb8 100644 --- a/packages/core/src/test/lambda/commands/uploadLambda.test.ts +++ b/packages/core/src/test/lambda/commands/uploadLambda.test.ts @@ -43,11 +43,6 @@ describe('uploadLambda', async function () { (await findApplicationJsonFile(folderUri))?.fsPath ?? '', path.join(tempFolder, '.application.json') ) - // Also test Cloud9 temporary workaround. - assertEqualPaths( - (await findApplicationJsonFile(folderUri, true))?.fsPath ?? '', - path.join(tempFolder, '.application.json') - ) }) it('finds application.json file from dir path - nested', async function () { @@ -56,8 +51,6 @@ describe('uploadLambda', async function () { await toFile('top secret data', appjsonPath) assertEqualPaths((await findApplicationJsonFile(folderUri))?.fsPath ?? '', appjsonPath) - // Also test Cloud9 temporary workaround. - assertEqualPaths((await findApplicationJsonFile(folderUri, true))?.fsPath ?? '', appjsonPath) }) it('finds application.json file from template file path', async function () { @@ -67,8 +60,6 @@ describe('uploadLambda', async function () { await toFile('top secret data', appjsonPath) assertEqualPaths((await findApplicationJsonFile(templateUri))?.fsPath ?? '', appjsonPath) - // Also test Cloud9 temporary workaround. - assertEqualPaths((await findApplicationJsonFile(templateUri, true))?.fsPath ?? '', appjsonPath) }) it('lists functions from .application.json', async function () { diff --git a/packages/core/src/test/techdebt.test.ts b/packages/core/src/test/techdebt.test.ts index a6d18dbcb58..71c8af4946b 100644 --- a/packages/core/src/test/techdebt.test.ts +++ b/packages/core/src/test/techdebt.test.ts @@ -14,12 +14,7 @@ describe('tech debt', function () { const minVscode = env.getMinVscodeVersion() assert.ok( - semver.lt(minVscode, '1.75.0'), - 'remove filesystemUtilities.findFile(), use vscode.workspace.findFiles() instead (after Cloud9 VFS fixes bug)' - ) - - assert.ok( - semver.lt(minVscode, '1.75.0'), + semver.lt(minVscode, '1.84.0'), 'remove AsyncLocalStorage polyfill used in `spans.ts` if Cloud9 is on node 14+' ) })