Skip to content

Commit

Permalink
Add reload flag on fastApi provider (#21241)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulacamargo25 authored May 15, 2023
1 parent fcfc54c commit b4a47bb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class DynamicPythonDebugConfigurationService implements IDynamicDebugConf
type: DebuggerTypeName,
request: 'launch',
module: 'uvicorn',
args: [`${fastApiPath}:app`],
args: [`${fastApiPath}:app`, '--reload'],
jinja: true,
justMyCode: true,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ export async function buildFastAPILaunchDebugConfiguration(
type: DebuggerTypeName,
request: 'launch',
module: 'uvicorn',
args: ['main:app'],
args: ['main:app', '--reload'],
jinja: true,
justMyCode: true,
};

if (!application) {
if (!application && config.args) {
const selectedPath = await input.showInputBox({
title: DebugConfigStrings.fastapi.enterAppPathOrNamePath.title,
value: 'main.py',
Expand All @@ -44,7 +44,7 @@ export async function buildFastAPILaunchDebugConfiguration(
});
if (selectedPath) {
manuallyEnteredAValue = true;
config.args = [`${path.basename(selectedPath, '.py').replace('/', '.')}:app`];
config.args[0] = `${path.basename(selectedPath, '.py').replace('/', '.')}:app`;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ suite('Debugging - Configuration Provider FastAPI', () => {
type: DebuggerTypeName,
request: 'launch',
module: 'uvicorn',
args: ['main:app'],
args: ['main:app', '--reload'],
jinja: true,
justMyCode: true,
};
Expand All @@ -73,7 +73,7 @@ suite('Debugging - Configuration Provider FastAPI', () => {
type: DebuggerTypeName,
request: 'launch',
module: 'uvicorn',
args: ['main:app'],
args: ['main:app', '--reload'],
jinja: true,
justMyCode: true,
};
Expand Down

0 comments on commit b4a47bb

Please sign in to comment.