16 releases

0.1.90 Nov 6, 2025
0.1.89 Jun 18, 2025
0.1.85 Mar 16, 2025
0.1.84 Nov 9, 2024
0.1.70 Mar 31, 2024

#472 in Text editors

Download history 186/week @ 2026-02-19 245/week @ 2026-02-26 167/week @ 2026-03-05 149/week @ 2026-03-12 115/week @ 2026-03-19 137/week @ 2026-03-26 137/week @ 2026-04-02 130/week @ 2026-04-09 137/week @ 2026-04-16 121/week @ 2026-04-23 105/week @ 2026-04-30 92/week @ 2026-05-07 119/week @ 2026-05-14 96/week @ 2026-05-21 122/week @ 2026-05-28 93/week @ 2026-06-04

446 downloads per month
Used in jinja-lsp

MIT license

87KB
2.5K SLoC

banner

jinja-lsp enhances minijinja development experience by providing Helix/Nvim users with advanced features such as autocomplete, syntax highlighting, hover, goto definition, code actions and linting.

crates.io visualstudio.com

Installation

cargo install jinja-lsp

or

download binary from releases page.

Features

Autocomplete

Intelligent suggestions for variables in current template, as well as variables, templates and filters defined on backend side.

Linting

Highlights errors and potential bugs in your jinja templates.

Hover Preview

See the complete filter or variable description by hovering over it.

Code Actions

It's recommended to reset variables on server in case you rename/delete file.

Goto Definition

Quickly jump to definition. Works for Rust identifiers as well.

https://github.com/uros-5/jinja-lsp/assets/59397844/015e47b4-b6f6-47c0-8504-5ce79ebafb00

Snippets

Document symbols

Configuration

Language server configuration(all fields are optional)

{ "templates": "./TEMPLATES_DIR", "backend": ["./BACKEND_DIR"], "lang": "rust"}

Helix configuration

[language-server.jinja-lsp]
command = "jinja-lsp"
config = { templates = "./templates", backend = ["./src"], lang = "rust"}
timeout = 5

[[language]]
name = "jinja"
language-servers = ["jinja-lsp"]

Neovim configuration

init.lua, I use kickstarter.nvim, it uses Mason.nvim for installing language servers.


-- if you want to debug
vim.lsp.set_log_level("debug")


require('lazy').setup(
  -- your other configs
  {
    -- Main LSP Configuration
    'neovim/nvim-lspconfig',
    dependencies = {
      -- dependencies
    },
    config = function() {
      -- keybindings etc.

      vim.filetype.add {
        extension = {
          jinja = 'jinja',
          jinja2 = 'jinja',
          j2 = 'jinja',
          py = 'python'
        },
      }
      local servers = {
        jinja_lsp = {
          filetypes = { 'jinja', 'rust', 'python' },
        },
        -- other servers        
      }
    end
  }
)

Adding custom template extensions:

template_extensions = ["j2", "tex"]

Custom jinja filters

filters = ["./example/custom-filters"]
**filter_name**

markdown description

You can also write configuration in: pyproject.toml, Cargo.toml, jinja-lsp.toml.

Python

[tool.jinja-lsp]
templates = "./templates"
backend = ["./src"]

Rust

[metadata.jinja-lsp]
templates = "./templates"
backend = ["./src"]

Supported languages: Python, Rust

Dependencies

~28MB
~593K SLoC