Skip to content

Run App button incorrectly treats .qmd as FastAPI #5323

Open

Description

System details:

Positron and OS details:

Positron Version: 2024.11.0 (Universal) build 140
Code - OSS Version: 1.93.0
Commit: e0d844b
Date: 2024-10-31T14:24:19.540Z
Electron: 30.4.0
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Darwin arm64 24.0.0

Interpreter details:

Python 3.12.0 in a Py script and a .qmd

Describe the issue:

When a FastAPI and a Quarto document exist in the same folder, Positron can keep the Run App button in focus and prefer it over the Quarto Preview button when moving from an example FastAPI (ie example.py) and a Quarto .qmd document.

Screen.Cast.2024-11-08.at.8.24.37.PM.mp4

Steps to reproduce the issue:

  1. Create a minimal FastAPI example.py and a minimal .qmd document
from fastapi import FastAPI

app = FastAPI()

@app.get("/")
async def root():
    return {"message": "Hello World"}

@app.get("/items/{item_id}")
async def read_item(item_id: int):
    return {"item_id": item_id}
---
title: "Example"
format: html
jupyter: python3
---


```{python}
5+5
```
  1. Focus on example.py, notice the "Run FastAPI in Terminal" as the first option in the play button.
  2. Move focus to the Quarto document and notice that the Preview icon has been replaced with a Run App button, and Preview is actually below the "Run FastAPI in Terminal" as the first option

Expected or desired behavior:

Quarto should not be treated as FastAPI and the Preview button should not be overwritten

Were there any error messages in the UI, Output panel, or Developer Tools console?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions