Python Fragments Extension for VS Code
VS Code extension for the Python Fragments transpiler - bringing HTML syntax directly into Python, similar to how JSX brings HTML into JavaScript.

Features
- Syntax highlighting for fragment syntax (
<>, </>, tags, {{ }} interpolations)
- Full LSP support via
fragments-lsp: diagnostics, hover, go-to-definition, completions, and semantic tokens powered by Pyright
Requirements
The fragments-lsp language server must be installed in your Python environment:
pip install fragments-lsp
The extension discovers the language server automatically from the Python interpreter selected in the Python extension.
Usage
Open any .py file that uses fragment syntax. The extension activates automatically for Python files.
Configuration
| Setting |
Description |
fragments.serverPath |
Override the path to the fragments-lsp executable. By default it is derived from the active Python interpreter. |
Commands
| Command |
Description |
Python Fragments: Restart Language Server |
Restart the LSP if it gets into a bad state. |
| |