Skip to content

Twig and Qiq definition navigation

Choose a tag to compare

@suzumaze suzumaze released this 07 Sep 07:56
· 195 commits to main since this release
9c77b64

Added

  • Added LSP textDocument/definition support for BEAR.Sunday Twig and Qiq templates.
  • Supports Twig embedded relations such as {{ user }} and {{ user|raw }}.
  • Supports current Qiq variables such as {{= $user }} / {{h $user }}.
  • Supports legacy Qiq $this->user references.
  • Supports absolute and relative BEAR Resource URIs used by #[Embed].

Safety

  • References outside the workspace are rejected.
  • Invalid, missing, or ambiguous references return no definition instead of throwing an exception.
  • Template rendering and arbitrary PHP execution are not performed.

Known limitation

The official Phpactor VS Code client currently sends PHP and Blade documents, but not Twig documents, to the language server. Therefore:

  • Qiq navigation works in the standard VS Code setup because Qiq templates are .php files.
  • Twig navigation requires an LSP client configured to send Twig documents to Phpactor.