This plugin provides support for the Pebble templating engine in IntelliJ IDEA 2017.3 and later.
- parser/lexer1 and syntax highlighter (supports custom delimiters)
- live templates for built-in tags
- braces matching, code folding and commenting
- quote handler
- navigation (methods and fields, included files)
- code completion
- highlight unknown references
- support for variables and functions introduced by pebble-spring
- more to come
1: Custom operators are currently not supported.
This plugin is available in JetBrains' plugin repository,
from your IDE go to Preferences > Plugins
and enter pebble
in the search bar.
To make the editor recognize two languages in the same file, for example HTML
and Pebble, go to Preferences > Languages & Frameworks > Template Data Languages
and select the HTML
data language on the directory that contains your Pebble
templates:
This will enable features like syntax highlighting, code completion, navigation, Emmet expansions etc.
In order to use code completion, you will have to let the plugin know what the type
of foo
is. This can be done using @pebvariable
hints, much like in the JSP, FreeMarker
and Velocity plugins:
@pebvariable
hints can be easily added to templates via the var
live template. They must
follow this syntax:
{# @pebvariable name="<name>" type="<type>" #}
For code completion to work properly in the type
attribute, your .peb
files need to be placed
under a content root (e.g. src/main/resources
).
Otherwise, classes defined in your own source files won't be suggested.
Snapshot builds are available as part of the Actions CI:
- go to https://github.com/bjansen/pebble-intellij/actions
- click on the latest build
- scroll to the bottom of the page, under the
Artifacts
section click onpebble-intellij-development
- this will download a zip file that can be installed in your IDE using Install plugin from disk