Flaxon 0.3.0 and Teloce-Py 0.3.0 are available on PyPI. Release instructions are maintained on this site; source links identify the framework snapshot. Check version and upgrade guidance.

Framework source ยท Markdown

Flaxon VS Code Extension Cheat Sheet

A quick reference for the most commonly used features of the Flaxon VS Code Extension.


๐Ÿš€ Commands

Open the Command Palette (Ctrl+Shift+P) and run:

Command Description
Flaxon: Create Project Create a new Flaxon project
Flaxon: Run App Run the current Flaxon application
Flaxon: Debug App Launch the debugger
Flaxon: Generate Route Create a new route
Flaxon: Generate Schema Generate a validation schema
Flaxon: Generate Plugin Generate a plugin
Flaxon: Show Routes Open the Route Explorer
Flaxon: Restart Language Server Restart the language server
Flaxon: Open Documentation Open the Flaxon documentation

โŒจ๏ธ Keyboard Shortcuts

Shortcut Action
Ctrl+Shift+P Open Command Palette
Ctrl+Shift+R Show Route Explorer
Ctrl+Shift+F5 Run Flaxon Application
Ctrl+Shift+U Open Output Panel
Ctrl+Shift+E Open Explorer
Ctrl+S Save file (refreshes routes)

๐Ÿ“ Route Explorer

Displays all discovered routes.

Flaxon Routes
โ”œโ”€โ”€ app.py
โ”‚   โ”œโ”€โ”€ GET /
โ”‚   โ”œโ”€โ”€ POST /login
โ”‚   โ””โ”€โ”€ GET /users
โ”œโ”€โ”€ api.py
โ”‚   โ”œโ”€โ”€ GET /api/posts
โ”‚   โ””โ”€โ”€ POST /api/posts
โ””โ”€โ”€ admin.py
    โ””โ”€โ”€ GET /admin

Method Colors

Method Color
GET ๐ŸŸข
POST ๐ŸŸ 
PUT ๐Ÿ”ต
DELETE ๐Ÿ”ด
PATCH ๐ŸŸฃ
WebSocket ๐Ÿ”ท

โšก CodeLens

Appears above route handlers.

@app.get("/users")
# โ–ถ Run    ๐Ÿ› Debug    ๐Ÿ“ References
async def get_users():
    ...

Available actions:

  • โ–ถ Run
  • ๐Ÿ› Debug
  • ๐Ÿ“ Find References

๐Ÿ’ก IntelliSense

Type:

@app.

Suggestions:

get
post
put
delete
patch
websocket

Other completions:

fields.
String
Integer
Float
Boolean
Email
Choice
UUID
DateTime

๐Ÿ“ Snippets

Trigger Generates
froute GET Route
fpost POST Route
fws WebSocket Route
fschema Schema
fvalidation Validation Route
fmiddleware Middleware
fplugin Plugin
ftest Test

Example:

froute + Tab

โ†“

@app.get("/api/users")
async def get_users(request):
    return {"users": []}

๐Ÿ”Ž Hover Documentation

Hover over:

  • @app.get
  • @app.post
  • Schema
  • fields.StrField
  • HTTPException

to view documentation.


๐Ÿ› Diagnostics

The extension checks for:

  • Missing imports
  • Missing app = Flaxon()
  • Non-async route handlers
  • Missing return values
  • Missing WebSocket accept()
  • Invalid schemas
  • Invalid decorators

โ–ถ Running Your App

Command Palette:

Flaxon: Run App

or

Ctrl+Shift+F5

๐Ÿž Debugging

Run:

Flaxon: Debug App

Supports:

  • Breakpoints
  • Variable inspection
  • Watch expressions
  • Call stack
  • Exceptions

๐Ÿ”ง Generate Code

Available generators:

  • Project
  • Route
  • Schema
  • Plugin

โš™๏ธ Important Settings

{
    "flaxon.entryPoint": "app:app",
    "flaxon.enableRouteExplorer": true,
    "flaxon.enableCodeLens": true,
    "flaxon.enableDiagnostics": true,
    "flaxon.enableCompletions": true,
    "flaxon.debug.reload": true,
    "flaxon.snippets.enable": true
}

๐Ÿ“Š Status Bar

Icon Meaning
โœ… Flaxon Ready
๐Ÿ”„ Flaxon Language Server Starting
โŒ Flaxon Error

๐Ÿ“‚ Supported Project Files

The extension activates automatically when it detects:

app.py
main.py
run.py
flaxon.py

๐Ÿš€ Development Workflow

Create Project
      โ”‚
      โ–ผ
Write Routes
      โ”‚
      โ–ผ
Use Snippets
      โ”‚
      โ–ผ
View Route Explorer
      โ”‚
      โ–ผ
Run Application
      โ”‚
      โ–ผ
Debug
      โ”‚
      โ–ผ
Test
      โ”‚
      โ–ผ
Commit

๐Ÿ›  Troubleshooting

Problem Solution
Extension not activating Open a Python file
No routes Save file
No CodeLens Enable flaxon.enableCodeLens
No completions Enable flaxon.enableCompletions
LSP stopped Run Flaxon: Restart Language Server
Debug not working Install the Python extension

Extension Purpose
Python Python support
Pylance IntelliSense
GitHub Pull Requests Git integration
Error Lens Better diagnostics
Better Comments Comment highlighting

โœ… Best Practices

  • Keep Route Explorer open.
  • Use snippets whenever possible.
  • Save files frequently.
  • Enable diagnostics.
  • Restart the Language Server if IntelliSense stops.
  • Use CodeLens to run and debug routes quickly.

Quick Reference

Feature Shortcut / Command
Command Palette Ctrl+Shift+P
Route Explorer Ctrl+Shift+R
Run App Ctrl+Shift+F5
Output Panel Ctrl+Shift+U
Restart Language Server Flaxon: Restart Language Server
Create Project Flaxon: Create Project

Happy coding with Flaxon! ๐Ÿš€