Flaxon for Visual Studio Code
Build, navigate, and run Flaxon applications without leaving VS Code. The extension adds route discovery, code generation, completions, hover help, diagnostics, snippets, and launch commands for Python projects that use Flaxon.
Feature previews
Route Explorer
See HTTP and WebSocket routes grouped by file in the Explorer. Select a route to open its handler.

Completions and API help
Type @app. for route decorators, fields. for validation fields, or request. for request APIs. Hover a supported API for a short reference and example.

Requirements
Quick start
Open your project folder in VS Code.
Create app.py:
from flaxon import Flaxon
app = Flaxon("my-api")
@app.get("/api/health")
async def health():
return {"status": "healthy"}
Open the Command Palette with Ctrl+Shift+P and choose Flaxon: Run App.
Open Flaxon: Show Routes to see the handler in the Route Explorer.
The default entry point is app:app. If your application is in main.py, set flaxon.entryPoint to main:app.
Coding assistance
The extension supplies these snippets in Python files. Enter a prefix and select it from IntelliSense, then press Tab to move through placeholders.
| Prefix |
Inserts |
froute |
GET route handler |
fpost |
POST route handler |
fws |
WebSocket handler |
fschema |
Schema using Flaxon validation fields |
fvalidation |
Validated POST endpoint |
fmiddleware |
Middleware template |
ftest |
API test starter |
Completion support includes route decorators (get, post, put, delete, patch, head, options, websocket), request APIs, and current PyPI Flaxon validation fields such as StrField, IntField, EmailField, and ChoiceField.
Commands
Open the Command Palette and run any of these commands:
| Command |
What it does |
| Flaxon: Create Project |
Creates a new Flaxon project in a folder you choose. |
| Flaxon: Run App |
Starts flaxon run in VS Code's integrated terminal. |
| Flaxon: Debug App |
Starts the application with the Python debugger. |
| Flaxon: Generate Route |
Creates a route module and imports the detected application. |
| Flaxon: Generate Schema |
Interactively creates a schema with valid Flaxon fields. |
| Flaxon: Show Routes |
Focuses the Route Explorer. |
| Flaxon: Restart Language Server |
Restarts Flaxon's diagnostics, completions, hover, definition, and references support. |
| Flaxon: Open Documentation |
Opens the Flaxon documentation site. |
Settings
{
"flaxon.pythonPath": "python",
"flaxon.entryPoint": "app:app",
"flaxon.debug.reload": true,
"flaxon.enableRouteExplorer": true,
"flaxon.enableCodeLens": true,
"flaxon.enableDiagnostics": true,
"flaxon.enableCompletions": true
}
Install from a VSIX
- Download the
.vsix release.
- In VS Code, open Extensions.
- Select the
... menu, then Install from VSIX....
- Choose the downloaded file and reload VS Code.
Development
npm install
npm test
npm run package
npm test compiles the extension, checks lint rules, runs language-server and parser regression tests, and verifies a packaged VSIX.
License
MIT