diff --git a/src/client/debugger/extension/configuration/resolvers/attach.ts b/src/client/debugger/extension/configuration/resolvers/attach.ts index 635dc88dbac4..096317bb065b 100644 --- a/src/client/debugger/extension/configuration/resolvers/attach.ts +++ b/src/client/debugger/extension/configuration/resolvers/attach.ts @@ -26,6 +26,9 @@ export class AttachConfigurationResolver extends BaseConfigurationResolver dbgConfig.debugOptions!.indexOf(item) === pos, ); } + if (debugConfiguration.clienOS === undefined) { + debugConfiguration.clientOS = getOSType() === OSType.Windows ? 'windows' : 'unix'; + } return debugConfiguration; } @@ -77,10 +80,8 @@ export class AttachConfigurationResolver extends BaseConfigurationResolver debugConfiguration: DebugConfiguration, _token?: CancellationToken, ): Promise { + if (debugConfiguration.clienOS === undefined) { + debugConfiguration.clientOS = getOSType() === OSType.Windows ? 'windows' : 'unix'; + } return debugConfiguration as T; } diff --git a/src/client/debugger/extension/configuration/resolvers/launch.ts b/src/client/debugger/extension/configuration/resolvers/launch.ts index d5cb419e031d..9513384f1277 100644 --- a/src/client/debugger/extension/configuration/resolvers/launch.ts +++ b/src/client/debugger/extension/configuration/resolvers/launch.ts @@ -50,6 +50,9 @@ export class LaunchConfigurationResolver extends BaseConfigurationResolver { const options = [DebugOptions.RedirectOutput]; if (osType === platform.OSType.Windows) { options.push(DebugOptions.FixFilePathCase); - options.push(DebugOptions.WindowsClient); - } else { - options.push(DebugOptions.UnixClient); } options.push(DebugOptions.ShowReturnValue); + return options; } @@ -76,6 +74,10 @@ getInfoPerOS().forEach(([osName, osType, path]) => { } } + function getClientOS() { + return osType === platform.OSType.Windows ? 'windows' : 'unix'; + } + function setupWorkspaces(folders: string[]) { const workspaceFolders = folders.map(createMoqWorkspaceFolder); getWorkspaceFoldersStub.returns(workspaceFolders); @@ -119,6 +121,7 @@ getInfoPerOS().forEach(([osName, osType, path]) => { expect(Object.keys(debugConfig!)).to.have.lengthOf.above(3); expect(debugConfig).to.have.property('request', 'attach'); + expect(debugConfig).to.have.property('clientOS', getClientOS()); expect(debugConfig).to.have.property('debugOptions').deep.equal(debugOptionsAvailable); }); @@ -134,6 +137,7 @@ getInfoPerOS().forEach(([osName, osType, path]) => { expect(Object.keys(debugConfig!)).to.have.lengthOf.least(3); expect(debugConfig).to.have.property('request', 'attach'); + expect(debugConfig).to.have.property('clientOS', getClientOS()); expect(debugConfig).to.have.property('debugOptions').deep.equal(debugOptionsAvailable); expect(debugConfig).to.have.property('host', 'localhost'); }); @@ -148,6 +152,7 @@ getInfoPerOS().forEach(([osName, osType, path]) => { expect(Object.keys(debugConfig!)).to.have.lengthOf.least(3); expect(debugConfig).to.have.property('request', 'attach'); + expect(debugConfig).to.have.property('clientOS', getClientOS()); expect(debugConfig).to.have.property('debugOptions').deep.equal(debugOptionsAvailable); expect(debugConfig).to.have.property('host', 'localhost'); }); @@ -164,6 +169,7 @@ getInfoPerOS().forEach(([osName, osType, path]) => { expect(Object.keys(debugConfig!)).to.have.lengthOf.least(3); expect(debugConfig).to.have.property('request', 'attach'); + expect(debugConfig).to.have.property('clientOS', getClientOS()); expect(debugConfig).to.have.property('debugOptions').deep.equal(debugOptionsAvailable); expect(debugConfig).to.not.have.property('localRoot'); expect(debugConfig).to.have.property('host', 'localhost'); @@ -181,6 +187,7 @@ getInfoPerOS().forEach(([osName, osType, path]) => { expect(Object.keys(debugConfig!)).to.have.lengthOf.least(3); expect(debugConfig).to.have.property('request', 'attach'); + expect(debugConfig).to.have.property('clientOS', getClientOS()); expect(debugConfig).to.have.property('debugOptions').deep.equal(debugOptionsAvailable); expect(debugConfig).to.have.property('host', 'localhost'); }); @@ -486,6 +493,7 @@ getInfoPerOS().forEach(([osName, osType, path]) => { debugOptions, }); + expect(debugConfig).to.have.property('clientOS', getClientOS()); expect(debugConfig).to.have.property('debugOptions').to.be.deep.equal(expectedDebugOptions); }); diff --git a/src/test/debugger/extension/configuration/resolvers/launch.unit.test.ts b/src/test/debugger/extension/configuration/resolvers/launch.unit.test.ts index e7e256468f84..4830b88a34fb 100644 --- a/src/test/debugger/extension/configuration/resolvers/launch.unit.test.ts +++ b/src/test/debugger/extension/configuration/resolvers/launch.unit.test.ts @@ -58,6 +58,10 @@ getInfoPerOS().forEach(([osName, osType, path]) => { return folder.object; } + function getClientOS() { + return osType === platform.OSType.Windows ? 'windows' : 'unix'; + } + function setupIoc(pythonPath: string, workspaceFolder?: WorkspaceFolder) { configService = TypeMoq.Mock.ofType(); diagnosticsService = TypeMoq.Mock.ofType(); @@ -160,6 +164,7 @@ getInfoPerOS().forEach(([osName, osType, path]) => { expect(Object.keys(debugConfig!)).to.have.lengthOf.above(3); expect(debugConfig).to.have.property('type', 'python'); expect(debugConfig).to.have.property('request', 'launch'); + expect(debugConfig).to.have.property('clientOS', getClientOS()); expect(debugConfig).to.not.have.property('pythonPath'); expect(debugConfig).to.have.property('python', pythonPath); expect(debugConfig).to.have.property('debugAdapterPython', pythonPath); @@ -188,6 +193,7 @@ getInfoPerOS().forEach(([osName, osType, path]) => { expect(Object.keys(debugConfig!)).to.have.lengthOf.above(3); expect(debugConfig).to.have.property('type', 'python'); expect(debugConfig).to.have.property('request', 'launch'); + expect(debugConfig).to.have.property('clientOS', getClientOS()); expect(debugConfig).to.not.have.property('pythonPath'); expect(debugConfig).to.have.property('python', pythonPath); expect(debugConfig).to.have.property('debugAdapterPython', pythonPath); @@ -215,6 +221,7 @@ getInfoPerOS().forEach(([osName, osType, path]) => { expect(Object.keys(debugConfig!)).to.have.lengthOf.above(3); expect(debugConfig).to.have.property('type', 'python'); expect(debugConfig).to.have.property('request', 'launch'); + expect(debugConfig).to.have.property('clientOS', getClientOS()); expect(debugConfig).to.not.have.property('pythonPath'); expect(debugConfig).to.have.property('python', pythonPath); expect(debugConfig).to.have.property('debugAdapterPython', pythonPath); @@ -239,6 +246,7 @@ getInfoPerOS().forEach(([osName, osType, path]) => { expect(Object.keys(debugConfig!)).to.have.lengthOf.above(3); expect(debugConfig).to.have.property('type', 'python'); + expect(debugConfig).to.have.property('clientOS', getClientOS()); expect(debugConfig).to.not.have.property('pythonPath'); expect(debugConfig).to.have.property('python', pythonPath); expect(debugConfig).to.have.property('debugAdapterPython', pythonPath); @@ -264,6 +272,7 @@ getInfoPerOS().forEach(([osName, osType, path]) => { expect(Object.keys(debugConfig!)).to.have.lengthOf.above(3); expect(debugConfig).to.have.property('type', 'python'); expect(debugConfig).to.have.property('request', 'launch'); + expect(debugConfig).to.have.property('clientOS', getClientOS()); expect(debugConfig).to.not.have.property('pythonPath'); expect(debugConfig).to.have.property('python', pythonPath); expect(debugConfig).to.have.property('debugAdapterPython', pythonPath); @@ -290,6 +299,7 @@ getInfoPerOS().forEach(([osName, osType, path]) => { expect(Object.keys(debugConfig!)).to.have.lengthOf.above(3); expect(debugConfig).to.have.property('type', 'python'); expect(debugConfig).to.have.property('request', 'launch'); + expect(debugConfig).to.have.property('clientOS', getClientOS()); expect(debugConfig).to.not.have.property('pythonPath'); expect(debugConfig).to.have.property('python', pythonPath); expect(debugConfig).to.have.property('debugAdapterPython', pythonPath); @@ -692,6 +702,7 @@ getInfoPerOS().forEach(([osName, osType, path]) => { }); expect(debugConfig).to.have.property('console', 'integratedTerminal'); + expect(debugConfig).to.have.property('clientOS', getClientOS()); expect(debugConfig).to.have.property('stopOnEntry', false); expect(debugConfig).to.have.property('showReturnValue', true); expect(debugConfig).to.have.property('debugOptions'); @@ -717,6 +728,7 @@ getInfoPerOS().forEach(([osName, osType, path]) => { }); expect(debugConfig).to.have.property('stopOnEntry', false); + expect(debugConfig).to.have.property('clientOS', getClientOS()); expect(debugConfig).to.have.property('showReturnValue', true); expect(debugConfig).to.have.property('debugOptions'); expect((debugConfig as DebugConfiguration).debugOptions).to.be.deep.equal([]); @@ -736,6 +748,7 @@ getInfoPerOS().forEach(([osName, osType, path]) => { }); expect(debugConfig).to.have.property('console', 'integratedTerminal'); + expect(debugConfig).to.have.property('clientOS', getClientOS()); expect(debugConfig).to.have.property('stopOnEntry', false); expect(debugConfig).to.have.property('showReturnValue', true); expect(debugConfig).to.have.property('redirectOutput', true); diff --git a/src/test/testing/common/debugLauncher.unit.test.ts b/src/test/testing/common/debugLauncher.unit.test.ts index dfe9e8ce5e99..b8841c380308 100644 --- a/src/test/testing/common/debugLauncher.unit.test.ts +++ b/src/test/testing/common/debugLauncher.unit.test.ts @@ -205,6 +205,9 @@ suite('Unit Tests - Debug Launcher', () => { if (!expected.python) { expected.python = 'python'; } + if (!expected.clientOS) { + expected.clientOS = isOs(OSType.Windows) ? 'windows' : 'unix'; + } if (!expected.debugAdapterPython) { expected.debugAdapterPython = 'python'; }