microsoft / microsoft/vscode-python-debugger

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

Aperta
#1,045 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

triage-needed
Lingua principale
TypeScript
Stelle
181
Fork
126
Merge medio
2g 3h
PR unite (30g)
3

Descrizione

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!

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia esaminando le configurazioni di debug attuali di FastAPI e il provider dinamico descritto nell'issue, insieme alle modifiche di vscode-python indicate. Confronta il loro comportamento di rilevamento di uvicorn e main.py con l'individuazione di file e progetti della fastapi CLI tramite pyproject.toml. Il lavoro è completato quando l'esperienza di debug offre chiaramente, tramite la CLI, opzioni separate per il file corrente e per l'ambito del progetto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
fastapi, python, typescript
Ambito
devtools, tooling
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.