diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ca75f6ef7727..16f398f5a166 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ on: permissions: {} env: - NODE_VERSION: 20.18.1 + NODE_VERSION: 22.17.0 PYTHON_VERSION: '3.10' # YML treats 3.10 the number as 3.1, so quotes around 3.10 # Force a path with spaces and to test extension works in these scenarios # Unicode characters are causing 2.7 failures so skip that for now. diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 65e80e1f6280..368d9d0dbb73 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -10,7 +10,7 @@ on: permissions: {} env: - NODE_VERSION: 20.18.1 + NODE_VERSION: 22.17.0 PYTHON_VERSION: '3.10' # YML treats 3.10 the number as 3.1, so quotes around 3.10 MOCHA_REPORTER_JUNIT: true # Use the mocha-multi-reporters and send output to both console (spec) and JUnit (mocha-junit-reporter). Also enables a reporter which exits the process running the tests if it haven't already. ARTIFACT_NAME_VSIX: ms-python-insiders-vsix diff --git a/build/azure-pipeline.pre-release.yml b/build/azure-pipeline.pre-release.yml index ab087673f1e7..e7159618d3ae 100644 --- a/build/azure-pipeline.pre-release.yml +++ b/build/azure-pipeline.pre-release.yml @@ -66,7 +66,7 @@ extends: buildSteps: - task: NodeTool@0 inputs: - versionSpec: '20.18.1' + versionSpec: '22.17.0' displayName: Select Node version - task: UsePythonVersion@0 diff --git a/build/azure-pipeline.stable.yml b/build/azure-pipeline.stable.yml index c68dacc7db80..ce67c69a3df4 100644 --- a/build/azure-pipeline.stable.yml +++ b/build/azure-pipeline.stable.yml @@ -60,7 +60,7 @@ extends: buildSteps: - task: NodeTool@0 inputs: - versionSpec: '20.18.1' + versionSpec: '22.17.0' displayName: Select Node version - task: UsePythonVersion@0 diff --git a/build/azure-pipelines/pipeline.yml b/build/azure-pipelines/pipeline.yml index ebb8a141d9d3..46302aa6ff90 100644 --- a/build/azure-pipelines/pipeline.yml +++ b/build/azure-pipelines/pipeline.yml @@ -37,13 +37,13 @@ extends: testPlatforms: - name: Linux nodeVersions: - - 20.18.1 + - 22.17.0 - name: MacOS nodeVersions: - - 20.18.1 + - 22.17.0 - name: Windows nodeVersions: - - 20.18.1 + - 22.17.0 testSteps: - template: /build/azure-pipelines/templates/test-steps.yml@self parameters: diff --git a/pythonExtensionApi/package-lock.json b/pythonExtensionApi/package-lock.json index ec175f1aaa5d..e462fc1c888a 100644 --- a/pythonExtensionApi/package-lock.json +++ b/pythonExtensionApi/package-lock.json @@ -14,7 +14,7 @@ "typescript": "~5.2" }, "engines": { - "node": ">=20.18.1", + "node": ">=22.17.0", "vscode": "^1.93.0" } }, diff --git a/pythonExtensionApi/package.json b/pythonExtensionApi/package.json index 9a27e5a09b0a..e4e956ff6065 100644 --- a/pythonExtensionApi/package.json +++ b/pythonExtensionApi/package.json @@ -13,7 +13,7 @@ "main": "./out/main.js", "types": "./out/main.d.ts", "engines": { - "node": ">=20.18.1", + "node": ">=22.17.0", "vscode": "^1.93.0" }, "license": "MIT", @@ -27,7 +27,7 @@ }, "devDependencies": { "typescript": "~5.2", - "@types/vscode": "^1.93.0", + "@types/vscode": "^1.102.0", "source-map": "^0.8.0-beta.0" }, "scripts": { diff --git a/src/client/common/process/logger.ts b/src/client/common/process/logger.ts index 47e9ef88fa4f..b65da8dc81e5 100644 --- a/src/client/common/process/logger.ts +++ b/src/client/common/process/logger.ts @@ -41,6 +41,13 @@ export class ProcessLogger implements IProcessLogger { }); } + /** + * Formats command strings for display by replacing common paths with symbols. + * - Replaces the workspace folder path with '.' if there's exactly one workspace folder + * - Replaces the user's home directory path with '~' + * @param command The command string to format + * @returns The formatted command string with paths replaced by symbols + */ private getDisplayCommands(command: string): string { if (this.workspaceService.workspaceFolders && this.workspaceService.workspaceFolders.length === 1) { command = replaceMatchesWithCharacter(command, this.workspaceService.workspaceFolders[0].uri.fsPath, '.'); diff --git a/src/test/common/process/logger.unit.test.ts b/src/test/common/process/logger.unit.test.ts index f1421ea58b85..366a7056e89e 100644 --- a/src/test/common/process/logger.unit.test.ts +++ b/src/test/common/process/logger.unit.test.ts @@ -109,32 +109,55 @@ suite('ProcessLogger suite', () => { test('Logger replaces the path/to/home with ~ in the command path where the home path IS NOT at the beginning of the path', async () => { const options = { cwd: path.join('debug', 'path') }; - logger.logProcess(path.join('net', untildify('~'), 'test'), ['--foo', '--bar'], options); + const untildifyStr = untildify('~'); + + let p1 = path.join('net', untildifyStr, 'test'); + if (p1.startsWith('.')) { + if (getOSType() === OSType.Windows) { + p1 = p1.replace(/^\.\\+/, ''); + } else { + p1 = p1.replace(/^\.\\/, ''); + } + } + logger.logProcess(p1, ['--foo', '--bar'], options); - sinon.assert.calledWithExactly(traceLogStub, `> ${path.join('net', '~', 'test')} --foo --bar`); + const path1 = path.join('.', 'net', '~', 'test'); + sinon.assert.calledWithExactly(traceLogStub, `> ${path1} --foo --bar`); sinon.assert.calledWithExactly(traceLogStub, `cwd: ${options.cwd}`); }); test('Logger replaces the path/to/home with ~ in the command path where the home path IS NOT at the beginning of the path but another arg contains other ref to home folder', async () => { const options = { cwd: path.join('debug', 'path') }; - logger.logProcess( - path.join('net', untildify('~'), 'test'), - ['--foo', path.join(untildify('~'), 'boo')], - options, - ); + let p1 = path.join('net', untildify('~'), 'test'); + if (p1.startsWith('.')) { + if (getOSType() === OSType.Windows) { + p1 = p1.replace(/^\.\\+/, ''); + } else { + p1 = p1.replace(/^\.\\/, ''); + } + } + logger.logProcess(p1, ['--foo', path.join(untildify('~'), 'boo')], options); sinon.assert.calledWithExactly( traceLogStub, - `> ${path.join('net', '~', 'test')} --foo ${path.join('~', 'boo')}`, + `> ${path.join('.', 'net', '~', 'test')} --foo ${path.join('~', 'boo')}`, ); sinon.assert.calledWithExactly(traceLogStub, `cwd: ${options.cwd}`); }); test('Logger replaces the path/to/home with ~ in the command path where the home path IS NOT at the beginning of the path between doble quotes', async () => { const options = { cwd: path.join('debug', 'path') }; - logger.logProcess(`"${path.join('net', untildify('~'), 'test')}" "--foo" "--bar"`, undefined, options); + let p1 = path.join('net', untildify('~'), 'test'); + if (p1.startsWith('.')) { + if (getOSType() === OSType.Windows) { + p1 = p1.replace(/^\.\\+/, ''); + } else { + p1 = p1.replace(/^\.\\/, ''); + } + } + logger.logProcess(`"${p1}" "--foo" "--bar"`, undefined, options); - sinon.assert.calledWithExactly(traceLogStub, `> "${path.join('net', '~', 'test')}" "--foo" "--bar"`); + sinon.assert.calledWithExactly(traceLogStub, `> "${path.join('.', 'net', '~', 'test')}" "--foo" "--bar"`); sinon.assert.calledWithExactly(traceLogStub, `cwd: ${options.cwd}`); });