microsoft / microsoft/vscode-python-debugger

Split FastAPI debug config into file-scoped and project-scoped options

Open
#1,045 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

triage-needed
Dominant language
TypeScript
Stars
181
Forks
126
Avg merge
2d 3h
Merged PRs (30d)
3

Description

Hey folks 👋 I work at @fastapilabs and maintain https://github.com/fastapi/fastapi-vscode. I've been looking at the broader FastAPI experience in VS Code and wanted to open an issue to discuss an improvement we've been discussing related to debugging.

The current FastAPI debug configurations (the snippet from microsoft/vscode-python#14606 and the dynamic provider added in #19505) launch the app via uvicorn ...:app --reload and rely on hand-rolled main.py detection. This predates the fastapi CLI (fastapi run / fastapi dev), which provides built-in app discovery via pyproject.toml or default file locations.

For an improved experience, I'd like to propose splitting the current debugging experience into two options:

  • Debug FastAPI with current file - runs fastapi run ${file} against the currently active file. This is optimal for single-file apps or quickly debugging a specific entry point.

  • Debug FastAPI - runs plain fastapi run and lets the CLI discover the app via pyproject.toml or default file locations. Doing this would also remove the extension's own detection logic in favor of the FastAPI CLI's resolution, and give users a clearer choice between file-scoped and project-scoped debugging.

Wanted to gauge whether there'd be appetite for this change. I already have a branch with most of this working locally and would be happy to put up a PR if it makes sense.

Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the current FastAPI debug configurations and dynamic provider described in the issue, along with the referenced vscode-python changes. Compare their uvicorn and main.py detection behavior with the fastapi CLI's file and project discovery through pyproject.toml. Done means the debugging experience clearly provides separate current-file and project-scoped options using the CLI.

Written by the indexing model from the issue text.

Assessment

Tech stack
fastapi, python, typescript
Domain
devtools, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.