Skip to content

Commit 161cd6b

Browse files
Improve python debug welcome view (#389)
* Add contribViewsWelcome api * Add when * Add context for dynamicConfigs * Update welcome view to run command to show dynamic configs for python * fix lint
1 parent 131b580 commit 161cd6b

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"enabledApiProposals": [
88
"portsAttributes",
99
"contribIssueReporter",
10-
"debugVisualization"
10+
"debugVisualization",
11+
"contribViewsWelcome"
1112
],
1213
"license": "MIT",
1314
"homepage": "https://github.com/Microsoft/vscode-python-debugger",
@@ -521,6 +522,13 @@
521522
"id": "inlineHexDecoder",
522523
"when": "debugConfigurationType == 'debugpy' && (variableType == 'float' || variableType == 'int')"
523524
}
525+
],
526+
"viewsWelcome": [
527+
{
528+
"view": "debug",
529+
"contents": "\n[Show automatic Python configurations](command:workbench.action.debug.selectandstart?%5B%22debugpy%22%5D)\n",
530+
"when": "dynamicPythonConfigAvailable"
531+
}
524532
]
525533
},
526534
"extensionDependencies": [

src/extension/extensionInit.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,5 +206,11 @@ export async function registerDebugger(context: IExtensionContext): Promise<IExt
206206
}),
207207
);
208208

209+
executeCommand(
210+
'setContext',
211+
'dynamicPythonConfigAvailable',
212+
window.activeTextEditor?.document.languageId === 'python',
213+
);
214+
209215
return buildApi();
210216
}

0 commit comments

Comments
 (0)