Skip to content

Commit

Permalink
Improve python debug welcome view (#389)
Browse files Browse the repository at this point in the history
* Add contribViewsWelcome api

* Add when

* Add context for dynamicConfigs

* Update welcome view to run command to show dynamic configs for python

* fix lint
  • Loading branch information
paulacamargo25 authored Jul 18, 2024
1 parent 131b580 commit 161cd6b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"enabledApiProposals": [
"portsAttributes",
"contribIssueReporter",
"debugVisualization"
"debugVisualization",
"contribViewsWelcome"
],
"license": "MIT",
"homepage": "https://github.com/Microsoft/vscode-python-debugger",
Expand Down Expand Up @@ -521,6 +522,13 @@
"id": "inlineHexDecoder",
"when": "debugConfigurationType == 'debugpy' && (variableType == 'float' || variableType == 'int')"
}
],
"viewsWelcome": [
{
"view": "debug",
"contents": "\n[Show automatic Python configurations](command:workbench.action.debug.selectandstart?%5B%22debugpy%22%5D)\n",
"when": "dynamicPythonConfigAvailable"
}
]
},
"extensionDependencies": [
Expand Down
6 changes: 6 additions & 0 deletions src/extension/extensionInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,5 +206,11 @@ export async function registerDebugger(context: IExtensionContext): Promise<IExt
}),
);

executeCommand(
'setContext',
'dynamicPythonConfigAvailable',
window.activeTextEditor?.document.languageId === 'python',
);

return buildApi();
}

0 comments on commit 161cd6b

Please sign in to comment.