Skip to content

Commit fa180dd

Browse files
Add pending changes in the debugger
1 parent b42b8d6 commit fa180dd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/extension/debugger/configuration/dynamicdebugConfigurationService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class DynamicPythonDebugConfigurationService implements IDynamicDebugConf
6868
type: DebuggerTypeName,
6969
request: 'launch',
7070
module: 'uvicorn',
71-
args: [`${fastApiPath}:app`],
71+
args: [`${fastApiPath}:app`, '--reload'],
7272
jinja: true,
7373
justMyCode: true,
7474
});

src/extension/debugger/configuration/providers/fastapiLaunch.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ export async function buildFastAPILaunchDebugConfiguration(
2525
type: DebuggerTypeName,
2626
request: 'launch',
2727
module: 'uvicorn',
28-
args: ['main:app'],
28+
args: ['main:app', '--reload'],
2929
jinja: true,
3030
justMyCode: true,
3131
};
3232

33-
if (!application) {
33+
if (!application && config.args) {
3434
const selectedPath = await input.showInputBox({
3535
title: DebugConfigStrings.fastapi.enterAppPathOrNamePath.title,
3636
value: 'main.py',
@@ -44,7 +44,7 @@ export async function buildFastAPILaunchDebugConfiguration(
4444
});
4545
if (selectedPath) {
4646
manuallyEnteredAValue = true;
47-
config.args = [`${path.basename(selectedPath, '.py').replace('/', '.')}:app`];
47+
config.args[0] = `${path.basename(selectedPath, '.py').replace('/', '.')}:app`;
4848
}
4949
}
5050

0 commit comments

Comments
 (0)