Skip to content

Commit f9f8627

Browse files
Simplify resolve path
1 parent 8234830 commit f9f8627

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/extension/debugger/configuration/utils/configuration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export function tryResolveFastApiArgs(folder: WorkspaceFolder, paths: Uri[]): st
8787
return undefined;
8888
}
8989
const relative = path.relative(folder.uri.fsPath, paths[0].fsPath);
90-
return relative.includes(path.sep) ? ['run', relative] : ['run'];
90+
return ['run', relative];
9191
}
9292

9393
export async function getFlaskPaths(folder: WorkspaceFolder | undefined) {

src/test/unittest/configuration/providers/fastapiLaunch.unit.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ suite('Debugging - Configuration Provider FastAPI', () => {
2828
sinon.restore();
2929
});
3030

31-
test('Single match at workspace root → plain `fastapi run`', async () => {
31+
test('Single match at workspace root → passes path explicitly', async () => {
3232
const folder = { uri: Uri.parse(path.join('one', 'two')), name: '1', index: 0 };
3333
const state = { config: {}, folder };
3434
getFastApiPathsStub.resolves([Uri.parse(path.join('one', 'two', 'main.py'))]);
@@ -40,7 +40,7 @@ suite('Debugging - Configuration Provider FastAPI', () => {
4040
type: DebuggerTypeName,
4141
request: 'launch',
4242
module: 'fastapi',
43-
args: ['run'],
43+
args: ['run', 'main.py'],
4444
jinja: true,
4545
};
4646

0 commit comments

Comments
 (0)