pebble-intellij
pebble-intellij copied to clipboard
Pebble support for IntelliJ IDEA
IntelliJ plugin for Pebble

This plugin provides support for the Pebble templating engine in IntelliJ IDEA 2017.3 and later.
Features
- 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.
Installation
This plugin is available in JetBrains' plugin repository,
from your IDE go to Preferences > Plugins
and enter pebble
in the search bar.
Mixing Pebble and other languages
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.
Using code completion
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.