Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>TypedJinjaNew to Visual Studio Code? Get it now.
TypedJinja

TypedJinja

dakixr

|
4 installs
| (0) | Free
| Sponsor
LSP support for type-safe Jinja2 templates using TypedJinja.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

TypedJinja VSCode Extension

A lightweight Python type system for Jinja2 templates with LSP features.

Prerequisites

  • The Python package typedjinja must be installed in your Python environment:
    pip install typedjinja
    

Features

  • Syntax highlighting for .jinja files
  • Go to Definition for macros and includes
  • Hover for types and documentation

Installation

  • Download the latest .vsix from the releases or build it yourself:
    pnpm install
    pnpm run package
    pnpm dlx vsce package
    
  • In VSCode, open the Extensions view, click the three dots, and select 'Install from VSIX...'

Usage

Open any .jinja or .html file to activate the extension.

Configuration

By default, the extension scans for Jinja2 templates in the templates directory at the workspace root. To customize this location, add a [tool.typedjinja] section to your project's pyproject.toml:

[tool.typedjinja]
templateRoot = "templates"  # path relative to workspace root

This setting tells the extension (and underlying language server) where to resolve template includes, macros, and imports.

Development Workflow

To set up and work on the extension locally:

  1. Clone the repository and navigate to the extension folder:
    git clone https://github.com/dakixr/TypedJinja.git
    cd TypedJinja/typedjinja-vscode
    
  2. Install Node.js dependencies:
    pnpm install
    
  3. Compile or watch the TypeScript source:
    • For a one-time compile:
      pnpm run compile
      
    • For continuous compilation (recommended):
      pnpm run watch
      
  4. Open the folder in VSCode and start the Extension Development Host (press F5).
  5. After development, build and package the VSIX:
    pnpm run package
    pnpm dlx vsce package
    

Contributing

Contributions are welcome! Please open issues or pull requests on GitHub.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft