Skip to content

Commit 288aa83

Browse files
committed
package: increase minimum vscode to 1.83
1 parent e72d016 commit 288aa83

File tree

7 files changed

+19
-63
lines changed

7 files changed

+19
-63
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Deprecation",
3+
"description": "Minimum required VS Code version is now 1.83"
4+
}

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.

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"license": "Apache-2.0",
1010
"engines": {
1111
"npm": "^10.1.0",
12-
"vscode": "^1.68.0"
12+
"vscode": "^1.83.0"
1313
},
1414
"activationEvents": [
1515
"onStartupFinished",

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

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ import AdmZip from 'adm-zip'
1212
import * as path from 'path'
1313
import { fsCommon } from '../../srcShared/fs'
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'
1919
import { getSamCliContext } from '../../shared/sam/cli/samCliContext'
2020
import { SamTemplateGenerator } from '../../shared/templates/sam/samTemplateGenerator'
2121
import { addCodiconToString } from '../../shared/utilities/textUtilities'
2222
import { getLambdaDetails, listLambdaFunctions } from '../utils'
23-
import { getIdeProperties, isCloud9 } from '../../shared/extensionUtilities'
23+
import { getIdeProperties } from '../../shared/extensionUtilities'
2424
import { createQuickPick, DataQuickPickItem } from '../../shared/ui/pickerPrompter'
2525
import { createCommonButtons } from '../../shared/ui/buttons'
2626
import { StepEstimator, Wizard, WIZARD_BACK } from '../../shared/wizards/wizard'
@@ -478,10 +478,7 @@ async function uploadZipBuffer(
478478
)
479479
}
480480

481-
export async function findApplicationJsonFile(
482-
startPath: vscode.Uri,
483-
cloud9 = isCloud9()
484-
): Promise<vscode.Uri | undefined> {
481+
export async function findApplicationJsonFile(startPath: vscode.Uri): Promise<vscode.Uri | undefined> {
485482
if (!(await fsCommon.exists(startPath.fsPath))) {
486483
getLogger().error(
487484
'findApplicationJsonFile() invalid path (not accessible or does not exist): "%s"',
@@ -491,17 +488,15 @@ export async function findApplicationJsonFile(
491488
}
492489
const isdir = await fsCommon.existsDir(startPath.fsPath)
493490
const parentDir = isdir ? startPath.fsPath : path.dirname(startPath.fsPath)
494-
const found = cloud9
495-
? await cloud9Findfile(parentDir, '.application.json')
496-
: await vscode.workspace.findFiles(
497-
new vscode.RelativePattern(parentDir, '**/.application.json'),
498-
// exclude:
499-
// - null = NO excludes apply
500-
// - undefined = default excludes apply (e.g. the `files.exclude` setting but not `search.exclude`).
501-
// eslint-disable-next-line unicorn/no-null
502-
null,
503-
1
504-
)
491+
const found = await vscode.workspace.findFiles(
492+
new vscode.RelativePattern(parentDir, '**/.application.json'),
493+
// exclude:
494+
// - null = NO excludes apply
495+
// - undefined = default excludes apply (e.g. the `files.exclude` setting but not `search.exclude`).
496+
// eslint-disable-next-line unicorn/no-null
497+
null,
498+
1
499+
)
505500
if (!found || found.length === 0) {
506501
getLogger().debug('uploadLambda: .application.json not found in: "%s"', parentDir)
507502
}

packages/core/src/shared/filesystemUtilities.ts

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -231,35 +231,6 @@ export async function hasFileWithSuffix(dir: string, suffix: string, exclude?: v
231231
return matchedFiles.length > 0
232232
}
233233

234-
/**
235-
* TEMPORARY SHIM for vscode.workspace.findFiles() on Cloud9.
236-
*
237-
* @param dir Directory to search
238-
* @param fileName Name of file to locate
239-
* @returns List of one or zero Uris (for compat with vscode.workspace.findFiles())
240-
*/
241-
export async function cloud9Findfile(dir: string, fileName: string): Promise<vscode.Uri[]> {
242-
getLogger().debug('cloud9Findfile: %s', dir)
243-
const files = await fsCommon.readdir(dir)
244-
const subDirs: vscode.Uri[] = []
245-
for (const file of files) {
246-
const [currentFileName] = file
247-
const filePath = path.join(dir, currentFileName)
248-
if (filePath === path.join(dir, fileName)) {
249-
return [vscode.Uri.file(filePath)]
250-
}
251-
if (await fsCommon.existsDir(filePath)) {
252-
subDirs.push(vscode.Uri.file(filePath))
253-
}
254-
}
255-
for (const d of subDirs) {
256-
const found = await cloud9Findfile(d.fsPath, fileName)
257-
if (found.length > 0) {
258-
return found
259-
}
260-
}
261-
return []
262-
}
263234
/**
264235
* @returns A string path to the last locally stored download location. If none, returns the users 'Downloads' directory path.
265236
*/

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ describe('uploadLambda', async function () {
4343
(await findApplicationJsonFile(folderUri))?.fsPath ?? '',
4444
path.join(tempFolder, '.application.json')
4545
)
46-
// Also test Cloud9 temporary workaround.
47-
assertEqualPaths(
48-
(await findApplicationJsonFile(folderUri, true))?.fsPath ?? '',
49-
path.join(tempFolder, '.application.json')
50-
)
5146
})
5247

5348
it('finds application.json file from dir path - nested', async function () {
@@ -56,8 +51,6 @@ describe('uploadLambda', async function () {
5651
await toFile('top secret data', appjsonPath)
5752

5853
assertEqualPaths((await findApplicationJsonFile(folderUri))?.fsPath ?? '', appjsonPath)
59-
// Also test Cloud9 temporary workaround.
60-
assertEqualPaths((await findApplicationJsonFile(folderUri, true))?.fsPath ?? '', appjsonPath)
6154
})
6255

6356
it('finds application.json file from template file path', async function () {
@@ -67,8 +60,6 @@ describe('uploadLambda', async function () {
6760
await toFile('top secret data', appjsonPath)
6861

6962
assertEqualPaths((await findApplicationJsonFile(templateUri))?.fsPath ?? '', appjsonPath)
70-
// Also test Cloud9 temporary workaround.
71-
assertEqualPaths((await findApplicationJsonFile(templateUri, true))?.fsPath ?? '', appjsonPath)
7263
})
7364

7465
it('lists functions from .application.json', async function () {

packages/core/src/test/techdebt.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@ describe('tech debt', function () {
1414
const minVscode = env.getMinVscodeVersion()
1515

1616
assert.ok(
17-
semver.lt(minVscode, '1.75.0'),
18-
'remove filesystemUtilities.findFile(), use vscode.workspace.findFiles() instead (after Cloud9 VFS fixes bug)'
19-
)
20-
21-
assert.ok(
22-
semver.lt(minVscode, '1.75.0'),
17+
semver.lt(minVscode, '1.84.0'),
2318
'remove AsyncLocalStorage polyfill used in `spans.ts` if Cloud9 is on node 14+'
2419
)
2520
})

0 commit comments

Comments
 (0)