diff --git a/src/common/settings.ts b/src/common/settings.ts index f08d09d6..fbb2ca9d 100644 --- a/src/common/settings.ts +++ b/src/common/settings.ts @@ -42,10 +42,12 @@ function resolveVariables( const home = process.env.HOME || process.env.USERPROFILE; if (home) { substitutions.set('${userHome}', home); + substitutions.set('~', home); } if (workspace) { substitutions.set('${workspaceFolder}', workspace.uri.fsPath); } + substitutions.set('${cwd}', process.cwd()); getWorkspaceFolders().forEach((w) => { substitutions.set('${workspaceFolder:' + w.name + '}', w.uri.fsPath); diff --git a/src/test/ts_tests/tests/common/settings.unit.test.ts b/src/test/ts_tests/tests/common/settings.unit.test.ts index 714f82dc..32685300 100644 --- a/src/test/ts_tests/tests/common/settings.unit.test.ts +++ b/src/test/ts_tests/tests/common/settings.unit.test.ts @@ -262,6 +262,7 @@ suite('Settings Tests', () => { '${workspaceFolder}/lib/python', '${workspaceFolder:workspace1}/lib/python', '${cwd}/lib/python', + '~/lib/python', ]) .verifiable(TypeMoq.Times.atLeastOnce()); pythonConfigMock @@ -286,6 +287,7 @@ suite('Settings Tests', () => { `${workspace1.uri.fsPath}/lib/python`, `${workspace1.uri.fsPath}/lib/python`, `${process.cwd()}/lib/python`, + `${process.env.HOME || process.env.USERPROFILE}/lib/python`, ]); configMock.verifyAll();