Upgrades in Latte plugin for PHPStorm

15 days ago

Member | 208


I'm working on upgrade for Latte plugin for PHPStorm. Now is in the beta version only, you can download and test it by download link. It can be installed from disk (help for install). I will be happy if as many people as possible try it out before we release the official version. There were a lot of changes, so let’s test it out.

Before stable will be released, new beta versions will be pushed to Github and in this forum will be posted information about new update. Download link will be same.


  • Custom template class… – More informations about new templateType macro. Macro varType is equivalent for /** @var string|null $foo */ and have this syntax: {vatType string|null $foo}.
  • I also created small update for Neon plugin


If you find some bug, please reply to this topic and I will add it to issues list.

Important notes

  • Refactoring for class names is now supported only from PHP to Latte


  • Increased minimum compatibility with PhpStorm version to 2017.3 from PhpStorm 8 (pre-2016.2 IDE version)
  • added support for PHP content
  • added variable types
  • added highlighting and go to source support for latte variables
  • added support for define custom default variables per project
  • added completions for latte variables, PHP functions, methods, constants and properties
  • added varType macro
  • added templateType macro
  • added support for define type in {var Bar\FooClass $class = …}
  • added support for mime types and completion it in contentType macro
  • added reference search for usages from PHP to Latte (for classes, methods, properties and constants)
  • added brace matcher for highlight braces
  • added go to source for class names, methods, constants and properties
  • added support for highlighting macro name and pair macro
  • added support for refactoring rename (methods, properties, constants and class names)
  • added code-completion for latte filters
  • added support for adding custom latte filters
  • added UI for setting custom variables, filters and macros
  • added inspections for:
    • class usages (Undefined class)
    • checking not defined variables, more definitions with same variable name etc.
    • checking constant, property and methods visibility (if is not public it make warning)
    • checking not existing constants, properties and methods
    • checking static methods and properties used non statically and vice versa
    • checking valid content for templateType, varType and var macro
    • checking existing latte filters


More of you wrote that they would like to contribute to development. I appreciate it, thanks. So I'm adding a link to PayPal and a bank account number. Donors will be posted here on the forum and in the future somewhere on the web with information about the Latte plugin (if you want, then write a payment note with your name for the recipient).

  • PayPal
  • BÚ: 2600850198/2010 (Fio banka)
Donor list

Last edited by mesour (2020-01-08 20:13)

15 days ago

Member | 208

Update 01

I added this to latest update (can be donwloaded by download link in main post):

  • Support for refactoring rename
  • Support for classes not starting with \ and completion without \
  • Added support for PHP functions (completions, reference…)
  • Added completion type hints like string, int… in varType macro
  • Added better support for strings and support for variable used in double quoted string like: "foo-string $bar"

This is new compared to the version that has been on the Slack.

14 days ago

Member | 208

Update 02

I added this to latest update (can be donwloaded by download link in main post):

  • Fixed bug with refactoring rename
  • Fixed bug in completion and reference class members if class name is without \ and if is |null in type
  • Added support for define type in {var Bar\FooClass $class = ...}
  • Added support for define variable in macro {capture $definition}
  • Added completion for content types to {contentType application/json} macro

I think this can be first release candidate. Because all important features are implemented. Only minor changes are in need fix section in issues list.

  • Please if someone have PHPStorm with Java version 8, test it. I change settings for project and try it compile it for Java 8, but it is hard to test for me with Java 11.

Last edited by mesour (2020-01-07 22:06)

13 days ago

Member | 208

Update 03

I added this to latest update (can be donwloaded by download link in main post):

  • Added some performance improvements
  • Added code-completion for latte filters
  • Added support for adding custom latte filters
  • Added UI for setting custom variables, filters and macros
  • Added inspection for checking existing latte filters

Now Im waiting for review and some things to solve around the merge to the main repository. After this it can be released. But I think it's good to wait a week or two for finding bugs in this version. Only adding templatePrint macro is planed to this version. Next features really in future versions.

If you want donate, I added a section to main post.

Last edited by mesour (2020-01-08 19:16)

8 days ago

Member | 208

Update 04

I added this to the latest update (can be downloaded by a download link in the main post):

  • Added support for templatePrint macro
  • Added tests for LattePhpLexer
  • Added completion for macro end tag
  • Improved n: attributes completion
  • Improved pages with settings for (macros, variables, and custom functions)
  • Fixed bug in completion for the end tag macro
  • Fixed annotator messages and annotating for some cases
  • Nette macros moved to custom configurations and can be disabled for the project with Latte only
  • Fixed bugs with unclosed block macro and translate macro
  • Fixed macro completion at the end of the file

I have created a pull request. Now it is mergeable without conflicts. Now I'm working only on testing and bug fixing.

Last edited by mesour (2020-01-13 21:10)