Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package: increase minimum vscode to 1.83 #4787

Closed
Closed
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Deprecation",
"description": "Minimum required VS Code version is now 1.83"
}
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "Apache-2.0",
"engines": {
"npm": "^10.1.0",
"vscode": "^1.68.0"
"vscode": "^1.83.0"
},
"activationEvents": [
"onStartupFinished",
Expand Down
29 changes: 12 additions & 17 deletions packages/core/src/lambda/commands/uploadLambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ 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'
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'
Expand Down Expand Up @@ -478,10 +478,7 @@ async function uploadZipBuffer(
)
}

export async function findApplicationJsonFile(
startPath: vscode.Uri,
cloud9 = isCloud9()
): Promise<vscode.Uri | undefined> {
export async function findApplicationJsonFile(startPath: vscode.Uri): Promise<vscode.Uri | undefined> {
if (!(await fsCommon.exists(startPath.fsPath))) {
getLogger().error(
'findApplicationJsonFile() invalid path (not accessible or does not exist): "%s"',
Expand All @@ -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)
}
Expand Down
29 changes: 0 additions & 29 deletions packages/core/src/shared/filesystemUtilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<vscode.Uri[]> {
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.
*/
Expand Down
9 changes: 0 additions & 9 deletions packages/core/src/test/lambda/commands/uploadLambda.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand All @@ -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 () {
Expand All @@ -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 () {
Expand Down
7 changes: 1 addition & 6 deletions packages/core/src/test/techdebt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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+'
)
})
Expand Down
Loading