microsoft / microsoft/vscode-python-debugger
Split FastAPI debug config into file-scoped and project-scoped options
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- TypeScript
- Estrelas
- 181
- Forks
- 126
- Merge médio
- 2d 3h
- PRs com merge (30d)
- 3
Descrição
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 runand lets the CLI discover the app viapyproject.tomlor 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!
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece revisando as configurações atuais de depuração do FastAPI e o provedor dinâmico descrito na issue, junto com as alterações referenciadas do vscode-python. Compare o comportamento de detecção de uvicorn e main.py com a descoberta de arquivos e projetos da fastapi CLI por meio de pyproject.toml. O trabalho estará concluído quando a experiência de depuração fornecer claramente, usando a CLI, opções separadas para o arquivo atual e para o escopo do projeto.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- fastapi, python, typescript
- Domínio
- devtools, tooling
- Tipo de issue
- Funcionalidade
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Pouca atividade
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 48/100