Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions editors/vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## Unreleased

- **Fix: the dev server is no longer interrupted seconds after it starts.** "Debug Pyxle app (React browser)" used to start `pyxle dev` by typing into a shell terminal. Anything may write to a shell terminal, and the Python extension activates your environment in every new one — through an API that sends `^C` first to interrupt whatever is running. The freshly started server was killed and the activation line (`pyenv shell …`, `source .venv/bin/activate`) typed in its place. The extension now owns the process directly, so nothing else can type into it; the panel still shows the server's output and Ctrl-C still stops it cleanly.
- **Fix: both debug configurations now run the same environment.** The React-browser flow ran whatever `pyxle` came first on your shell `PATH` while the Python flow ran VS Code's selected interpreter — routinely two different installs of two different versions. It now uses the selected interpreter for both, with the same pre-launch check.
- **A stale editable install is no longer mistaken for an old one.** The pre-launch check asks what the interpreter *can do* (can it run `python -m pyxle`) rather than what its package metadata claims, so an editable/dev install whose dist-info still says `0.7.5` while the code is current launches normally.
- **The interpreter errors are no longer a dead end.** Both the "pyxle not installed" and the "too old" message now lead with **Select Interpreter** — the usual cause is that the right pyxle lives in a *different* environment — and the launch continues automatically once you pick one. The message also reports the version it found (labelled as package metadata) and offers the matching install/upgrade/repair command.
- **New: the Python interpreter is visible and switchable from `.pyxl` files.** The Python extension only shows its interpreter indicator for `.py` files, so in a `.pyxl` editor you could neither see nor change the interpreter that debugging uses. A status-bar item now shows it (click to change), with a new **Pyxle: Select Python Interpreter** command.
- **A pre-launch check that can't answer no longer blocks the launch.** If the interpreter crashes, times out, or won't start, the debugger now goes ahead and lets the debugger report the real error instead of claiming pyxle isn't installed.
- **A dev server the extension started is stopped when VS Code shuts down normally**, rather than being left running and holding its port. It runs in its own process group so one signal takes the whole tree (Vite and the SSR workers) down with it; that also means a force-quit or an extension-host crash can still leave it running, in which case stop it from the terminal it prints to.
- Command palette entries no longer read "Pyxle: Pyxle: …".

## 0.3.0

- **Breakpoint debugging of `.pyxl` files.** New `pyxle` debug type. Press **F5** ("Debug Pyxle app") to run your dev server under the debugger — one clean session with a real Stop/Restart/Pause — and open your app. Breakpoints bind in the Python half (`@server` loaders, `@action` handlers). Debug the React half (JSX) with the separate "Debug Pyxle app (React browser)" configuration (`"server": false`), a standalone Chrome session against the same dev server. Both halves of a page are breakpointable in the one `.pyxl` file you already have open. Also supports `"request": "attach"` for an already-running `pyxle dev --inspect`.
Expand Down
2 changes: 1 addition & 1 deletion editors/vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The command **"Pyxle: Open Studio"** opens the running dev server's [Studio dash

## Requirements

- **[pyxle-framework](https://pypi.org/project/pyxle-framework/) 0.8.0 or newer** in your project's Python environment (the launch model runs `python -m pyxle dev`, and `.pyxl` debugging relies on the framework's line mapping shipped in 0.8.0). Point VS Code at that environment with **Python: Select Interpreter** — the debugger checks it has pyxle before launching and guides you if not.
- **[pyxle-framework](https://pypi.org/project/pyxle-framework/) 0.8.0 or newer** in your project's Python environment (the launch model runs `python -m pyxle dev`, and `.pyxl` debugging relies on the framework's line mapping shipped in 0.8.0). Both debug configurations use the interpreter VS Code has selected — the status-bar item shown while a `.pyxl` file is open tells you which one that is, and clicking it (or **Pyxle: Select Python Interpreter**) changes it. The debugger checks the interpreter can run the dev server before launching and, if it can't, offers to switch to one that can.
- The **[Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python)** (`ms-python.python`) for the Python side of debugging. The debugger offers to install it if it's missing, and still debugs the React side without it.
- The language server: `pip install pyxle-langkit` (bundled as a default dependency of `pyxle-framework`, so a normal Pyxle project already has it).

Expand Down
26 changes: 16 additions & 10 deletions editors/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Pyxle Language Tools",
"publisher": "pyxle",
"version": "0.3.0",
"description": "Language support and debugging for Pyxle .pyxl files syntax highlighting, diagnostics, completions, hover, go-to-definition, formatting, and full-stack breakpoint debugging.",
"description": "Language support and debugging for Pyxle .pyxl files \u2014 syntax highlighting, diagnostics, completions, hover, go-to-definition, formatting, and full-stack breakpoint debugging.",
"license": "MIT",
"repository": {
"type": "git",
Expand Down Expand Up @@ -31,8 +31,7 @@
],
"activationEvents": [
"onLanguage:pyxle",
"onDebugResolve:pyxle",
"onCommand:pyxle.openStudio"
"onDebugResolve:pyxle"
],
"main": "./out/extension.js",
"scripts": {
Expand All @@ -53,12 +52,17 @@
"commands": [
{
"command": "pyxle.openStudio",
"title": "Pyxle: Open Studio",
"title": "Open Studio",
"category": "Pyxle"
},
{
"command": "pyxle.showInstallGuide",
"title": "Pyxle: Show Language Server Install Guide",
"title": "Show Language Server Install Guide",
"category": "Pyxle"
},
{
"command": "pyxle.selectPythonInterpreter",
"title": "Select Python Interpreter",
"category": "Pyxle"
}
],
Expand All @@ -79,12 +83,12 @@
},
"server": {
"type": "boolean",
"description": "Debug the Python side run the dev server under debugpy so breakpoints in @server loaders and @action handlers bind. Set false to debug only the React/JSX side in a standalone Chrome session.",
"description": "Debug the Python side \u2014 run the dev server under debugpy so breakpoints in @server loaders and @action handlers bind. Set false to debug only the React/JSX side in a standalone Chrome session.",
"default": true
},
"browser": {
"type": "boolean",
"description": "When debugging the Python side, open the app in your browser once the dev server is ready. (React/JSX debugging is a separate launch set \"server\": false.)",
"description": "When debugging the Python side, open the app in your browser once the dev server is ready. (React/JSX debugging is a separate launch \u2014 set \"server\": false.)",
"default": true
},
"url": {
Expand All @@ -94,7 +98,9 @@
"args": {
"type": "array",
"description": "Extra arguments passed to `pyxle dev` (e.g. [\"--port\", \"3000\"]).",
"items": { "type": "string" },
"items": {
"type": "string"
},
"default": []
},
"justMyCode": {
Expand Down Expand Up @@ -148,7 +154,7 @@
"configurationSnippets": [
{
"label": "Pyxle: Debug app (Python)",
"description": "Run the dev server under the debugger breakpoints in .pyxl @server loaders and @action handlers bind. Opens the app in your browser. One clean debug session.",
"description": "Run the dev server under the debugger \u2014 breakpoints in .pyxl @server loaders and @action handlers bind. Opens the app in your browser. One clean debug session.",
"body": {
"type": "pyxle",
"request": "launch",
Expand All @@ -157,7 +163,7 @@
},
{
"label": "Pyxle: Debug React (browser)",
"description": "Debug the React/JSX half in a standalone Chrome session against the running dev server breakpoints in .pyxl components bind.",
"description": "Debug the React/JSX half in a standalone Chrome session against the running dev server \u2014 breakpoints in .pyxl components bind.",
"body": {
"type": "pyxle",
"request": "launch",
Expand Down
Loading