feat(run): add Flask and FastAPI run configurations (#6647)

Flask and FastAPI apps could only run as ordinary scripts. Adds Flask server and FastAPI run configuration types: Flask runs python -m flask run with FLASK_APP / FLASK_DEBUG (read by every Flask version), host, port and extra options; FastAPI runs python -m uvicorn <module:app> with reload, host, port and options. Both use the Python interpreter choice and debug with debugpy; under the debugger Flask runs with --no-debugger, and without subprocess attach the reloader is turned off so breakpoints still stop.

A top-level (or src/) app.py, wsgi.py, main.py or app/main.py assigning Flask(...) or FastAPI(...) to a module-level name gets a detected configuration. The list of Python run kinds is now one function (ide_run::is_python_kind) instead of copies in the host, Docker, process and SDK code.

Closes #6532

Co-authored-by: wildcatDownstairs <[email protected]>
Цей коміт міститься в:
LU XIANGRUIтаwildcatDownstairs authored and GitHub committed 2026-11-29 13:25:10 +08:00
1 джерело 9ee8f67e9f
коміт e30ae3f6b8
21 files changed
+513 -23

No files matched your search

+8 -3
Переглянути файл
@@ -1887,10 +1887,15 @@ export interface RunConfigTypeContribution {
/**
* What is launched for `params`; null when the type runs no process itself (Compound).
* `stop`: a shell command line run on Stop before the process is signalled (`docker stop …`).
* `setEnv`: environment variables the params set (`FLASK_APP`); `null` removes one they set before.
*/
commandLine(
params: Readonly<Record<string, string>>,
): { command: string; args: string[]; cwd?: string | null; stop?: string | null } | null;
commandLine(params: Readonly<Record<string, string>>): {
command: string;
args: string[];
cwd?: string | null;
stop?: string | null;
setEnv?: Readonly<Record<string, string | null>>;
} | null;
/** Params that reproduce a configuration made elsewhere (detection, older files); null when it doesn't fit. */
paramsFrom?(config: RunConfig): Record<string, string> | null;
/** The type's fields set the working directory (no separate field). */