microsoft / microsoft/vscode-python-debugger
Split FastAPI debug config into file-scoped and project-scoped options
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 181
- 派生
- 126
- 平均合并
- 2 天 3 小时
- 30 天内合并 PR
- 3
描述
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!
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先查看当前的 FastAPI 调试配置和 issue 中描述的动态 provider,以及所引用的 vscode-python 更改。将它们对 uvicorn 和 main.py 的检测行为与 fastapi CLI 通过 pyproject.toml 进行文件和项目发现的行为进行比较。当调试体验使用 CLI 明确提供当前文件和项目范围的独立选项时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- fastapi, python, typescript
- 领域
- devtools, tooling
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100