Skip to content

Commit 4f450de

Browse files
authored
Support the clientOS property in VS code (#550)
1 parent 1b6ac0d commit 4f450de

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

package.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,15 @@
278278
"default": "Python Debug Console",
279279
"description": "Display name of the debug console or terminal",
280280
"type": "string"
281+
},
282+
"clientOS": {
283+
"default": null,
284+
"description": "OS that VS code is using.",
285+
"enum": [
286+
"windows",
287+
null,
288+
"unix"
289+
]
281290
}
282291
}
283292
},
@@ -508,6 +517,15 @@
508517
"default": "Python Debug Console",
509518
"description": "Display name of the debug console or terminal",
510519
"type": "string"
520+
},
521+
"clientOS": {
522+
"default": null,
523+
"description": "OS that VS code is using.",
524+
"enum": [
525+
"windows",
526+
null,
527+
"unix"
528+
]
511529
}
512530
}
513531
}

src/extension/debugger/configuration/resolvers/attach.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class AttachConfigurationResolver extends BaseConfigurationResolver<Attac
2727
(item, pos) => dbgConfig.debugOptions!.indexOf(item) === pos,
2828
);
2929
}
30-
if (debugConfiguration.clientOS === undefined) {
30+
if (!debugConfiguration.clientOS) {
3131
debugConfiguration.clientOS = getOSType() === OSType.Windows ? 'windows' : 'unix';
3232
}
3333
return debugConfiguration;
@@ -80,7 +80,7 @@ export class AttachConfigurationResolver extends BaseConfigurationResolver<Attac
8080
if (getOSType() === OSType.Windows && isLocalHost) {
8181
AttachConfigurationResolver.debugOption(debugOptions, DebugOptions.FixFilePathCase);
8282
}
83-
if (debugConfiguration.clientOS === undefined) {
83+
if (!debugConfiguration.clientOS) {
8484
debugConfiguration.clientOS = getOSType() === OSType.Windows ? 'windows' : 'unix';
8585
}
8686
if (debugConfiguration.showReturnValue) {

src/extension/debugger/configuration/resolvers/base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export abstract class BaseConfigurationResolver<T extends DebugConfiguration>
3939
debugConfiguration: DebugConfiguration,
4040
_token?: CancellationToken,
4141
): Promise<T | undefined> {
42-
if (debugConfiguration.clientOS === undefined) {
42+
if (!debugConfiguration.clientOS) {
4343
debugConfiguration.clientOS = getOSType() === OSType.Windows ? 'windows' : 'unix';
4444
}
4545
if (debugConfiguration.consoleName) {

src/extension/debugger/configuration/resolvers/launch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class LaunchConfigurationResolver extends BaseConfigurationResolver<Launc
3737

3838
const workspaceFolder = LaunchConfigurationResolver.getWorkspaceFolder(folder);
3939
await this.resolveAndUpdatePaths(workspaceFolder, debugConfiguration);
40-
if (debugConfiguration.clientOS === undefined) {
40+
if (!debugConfiguration.clientOS) {
4141
debugConfiguration.clientOS = getOSType() === OSType.Windows ? 'windows' : 'unix';
4242
}
4343
if (debugConfiguration.consoleName) {

0 commit comments

Comments
 (0)