Skip to content

Commit feecfc1

Browse files
DonJayamanneAman Agarwal
authored andcommitted
Pass OS type to the debugger (#2129)
1 parent 6841d43 commit feecfc1

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

news/3 Code Health/2128.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Pass OS type to the debugger.

src/client/debugger/Common/Contracts.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ export enum DebugOptions {
4848
Sudo = 'Sudo',
4949
Pyramid = 'Pyramid',
5050
FixFilePathCase = 'FixFilePathCase',
51-
WindowsClient = 'WindowsClient'
51+
WindowsClient = 'WindowsClient',
52+
UnixClient = 'UnixClient'
5253
}
5354

5455
export interface ExceptionHandling {

src/client/debugger/configProviders/pythonV2Provider.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ export class PythonV2DebugConfigurationProvider extends BaseConfigurationProvide
8282
}
8383
if (this.serviceContainer.get<IPlatformService>(IPlatformService).isWindows) {
8484
this.debugOption(debugOptions, DebugOptions.WindowsClient);
85+
} else {
86+
this.debugOption(debugOptions, DebugOptions.UnixClient);
8587
}
8688

8789
if (!debugConfiguration.pathMappings) {

src/test/debugger/configProvider/provider.attach.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,13 @@ enum OS {
3333
let platformService: TypeMoq.IMock<IPlatformService>;
3434
let fileSystem: TypeMoq.IMock<IFileSystem>;
3535
const debugOptionsAvailable = [DebugOptions.RedirectOutput];
36-
if (os.value === OS.Windows && provider.debugType === 'pythonExperimental') {
37-
debugOptionsAvailable.push(DebugOptions.FixFilePathCase);
38-
debugOptionsAvailable.push(DebugOptions.WindowsClient);
36+
if (provider.debugType === 'pythonExperimental') {
37+
if (os.value === OS.Windows) {
38+
debugOptionsAvailable.push(DebugOptions.FixFilePathCase);
39+
debugOptionsAvailable.push(DebugOptions.WindowsClient);
40+
} else {
41+
debugOptionsAvailable.push(DebugOptions.UnixClient);
42+
}
3943
}
4044
setup(() => {
4145
serviceContainer = TypeMoq.Mock.ofType<IServiceContainer>();

0 commit comments

Comments
 (0)