Professional-grade Jinja2 template support for JetBrains IDEs with comprehensive syntax analysis, intelligent error detection, advanced language features, and a rich Extension API for framework integrations.
| Area | Coverage | Details |
|---|---|---|
| Language Registration | 90% | FileType, file extensions, template language, language substitution |
| Lexer | 100% | {{ }}, {% %}, {# #}, identifiers, keywords, strings, numbers, operators, punctuation, whitespace-control tokens ({{-, -}}, {%-, -%}) |
| Parser | 90% | Expressions, statements, filters, tests, calls, macros, blocks, imports, assignments, control flow |
| PSI Model | 85% | File, expression, statement, variable, macro, block, filter, test, import, include, reference PSI |
- Literals: strings, numbers, booleans,
none, lists, tuples, dicts - Variables and attribute access:
foo.bar,foo["bar"] - Function calls, arithmetic, comparisons, boolean/membership operators
- Filters (
|), tests (is), conditional expressions (x if cond else y)
if/elif/else/endif, for/endfor, set, block/endblock, extends, include, import, from...import, macro/endmacro, call/endcall, filter/endfilter, with/endwith, raw/endraw
- Delimiters, keywords, identifiers, variables, strings, numbers, operators
- Filter and test highlighting, macro and comment highlighting
- Custom color schemes for Default and Darcula themes
- Keywords, statements, scope-aware variables
- Built-in filters (50+), tests (20+), globals
- Macros, macro parameters, blocks
- Template paths for
include,extends,import
- Go to declaration / definition
- Find usages
- Go to macro, block, included/imported/parent template
| Inspection | Status |
|---|---|
| Undefined variable | Done |
| Unknown filter / test | Done |
| Duplicate macro | Done |
| Unused variable / macro | Done |
| Invalid inheritance | Done |
| Unknown macro | Partial |
| Invalid macro invocation | Partial |
| Missing template | Planned |
| Wrong argument count | Planned |
| Duplicate block | Planned |
| Shadowed variable | Planned |
| Unreachable branch | Planned |
Planned: add missing end-tag, create macro/template, import macro, correct filter/test name, remove unused declaration, rename unresolved symbol.
- Find usages before delete — done
- Rename variable/macro/block/imported symbol — planned
- Safe delete, conflict detection — planned
extendsand parent template resolution- Child template relationships, block override detection
super()support, block hierarchy, inheritance navigation
includewith/without context,ignore missingimport,from...import, macro namespace resolution
- Matching tag highlighting (
if↔endif,for↔endfor, etc.) - Auto-close blocks, comment/uncomment, brace matching
- Indentation support, smart Enter
All block structures: if, for, macros, blocks, filter blocks, raw blocks, large comments.
- Indentation, nested blocks, spaces inside
{{ }}/{% %} - Operator and filter formatting, macro parameters
- Configurable Code Style settings (
Ctrl+Alt+L/Cmd+Alt+L)
Ctrl+Q / F1 — documentation for keywords, statements, filters, tests, globals, macros, user variables, template references.
- Global, template, loop, macro scopes — working
- Block, call, with scopes — planned
- Imported scope and shadowing rules — partial
Local variables, set/for variables, loop special variable, macro arguments, imported macros/variables, block and template references, globals.
- Filters (50+):
abs,attr,batch,capitalize,center,default,dictsort,escape,filesizeformat,first,float,format,groupby,indent,int,join,last,length,list,lower,map,max,min,pprint,random,reject,rejectattr,replace,reverse,round,safe,select,selectattr,slice,sort,string,striptags,sum,title,tojson,trim,truncate,unique,upper,urlencode,urlize,wordcount,wordwrap,xmlattr, and more - Tests (20+):
callable,defined,divisibleby,equalto,escaped,even,false,filter,float,ge,gt,iterable,le,lower,lt,mapping,ne,none,number,odd,sameas,sequence,string,test,true,undefined,upper - Global functions:
range,lipsum,dict,cycler,joiner,namespace - Loop object:
loop.index,loop.index0,loop.revindex,loop.revindex0,loop.first,loop.last,loop.length,loop.cycle,loop.depth,loop.depth0,loop.previtem,loop.nextitem,loop.changed
Custom variable/block/comment delimiters, trim_blocks, lstrip_blocks, line statements, line comments.
| Host Language | Coverage |
|---|---|
| HTML + Jinja | 70% |
| YAML + Jinja | 60% |
| Plain text + Jinja | 60% |
| JSON + Jinja | 20% |
| XML + Jinja | 20% |
| CSS + Jinja | 10% |
| JavaScript + Jinja | 10% |
| Shell + Jinja | 10% |
Rapid development with predefined snippets:
for→{% for item in items %}...{% endfor %}if→{% if condition %}...{% endif %}macro→{% macro name(params) %}...{% endmacro %}block→{% block name %}...{% endblock %}- And more...
A rich set of extension points for framework integrations and third-party plugins.
| API | Coverage | Extension Points |
|---|---|---|
| Globals / Functions | 60% | FunctionProvider |
| Variable Provider | 95% | VariableProvider, ScopeVariableProvider, AssignmentTagProvider |
| Filter API | 95% | FilterProvider (deprecation, custom resolve, return type) |
| Test API | 90% | TestProvider (deprecation metadata) |
| Callable API | 80% | MacroModuleProvider |
| Object / Type Model | 75% | TypeSchemaProvider, DynamicTypeProvider |
| Template Root Provider | 85% | TemplateRootProvider |
| Template Resolver | 85% | Jinja2TemplateResolver |
| Symbol Provider | 70% | VariableProvider, MacroModuleProvider, AssignmentTagProvider |
| Reference Resolver | 85% | MacroModuleProvider, AssignmentTagProvider |
| Completion Provider | 100% | CompletionContributor, Original Position Context |
| Documentation Provider | 90% | DocumentationProvider |
| Inspection API | 80% | InspectionRuleProvider, AssignmentTagProvider |
| Quick Fix API | 20% | Jinja2QuickFixProvider |
| Context Provider | 70% | Jinja2ApiConfigProvider, ScopeVariableProvider |
| Language Environment | 95% | Jinja2ApiConfigProvider, DelimiterProvider |
| Jinja Extension (custom tags) | 90% | TagBehaviorProvider, AssignmentTagProvider |
| File Context | 60% | InjectionLanguageProvider, LiveTemplateContextProvider |
| Host Language | 70% | InjectionLanguageProvider |
| Navigation | 80% | AssignmentTagProvider, DynamicTypeProvider, FilterProvider |
| Usage / Search | 80% | AssignmentTagProvider |
| Type Inference | 80% | TypeSchemaProvider, ScopeVariableProvider, DynamicTypeProvider, FilterProvider |
| Index Contribution | 70% | SymbolIndexContributor |
| Metadata Source | 15% | MetadataSource, static JSON, project metadata files |
| Lifecycle / Cache | 75% | Jinja2ProviderLifecycle |
| Rename / Refactoring | 10% | Planned |
| Compatibility | 10% | Planned |
Provider file scoping: Filter/Test/Function providers can limit descriptors to specific host files.
- Open IDE Settings → Plugins
- Search for "Jinja2 Enhanced Support"
- Click Install
- Restart IDE
Settings → Tools → Jinja2 Language Injection
- Enable/disable global injection
- Add file extensions (
.html,.yml,.yaml,.xml,.txt) - Per-file injection control
Settings → Editor → Code Style → Jinja2
- Tabs and Indents: indent size, continuation indent
- Spaces: around operators, after commas
- Blank Lines: between sections
Right-click in editor:
- Enable Jinja2 Highlighting — enable for current file
- Associate with Jinja2 Enhanced — change file type association
- IDE Version: 2022.3+ (build 223.0 - 253.*)
- Supported IDEs:
- IntelliJ IDEA (Community, Ultimate)
- PyCharm (Community, Professional)
- WebStorm
- PhpStorm
- RubyMine
- GoLand
- CLion
- All other JetBrains IDEs with Python support
This project is licensed under the MIT License - see the LICENSE file for details.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with ❤ by SomeBlackMagic