diff --git a/README.md b/README.md index 0d9000c..1de740c 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,19 @@ Qiq Templates Support is an IntelliJ-based plugin that brings syntax highlightin - **Syntax highlighting** for Qiq control structures, escape modifiers (`{{= }}`, `{{h }}`, etc.), and HTML blocks. - **PHP language injection** inside Qiq tokens and inline `` islands so that autocompletion, inspections, and formatting work as expected. +- **Type-aware escape directives**: `{{h }}`, `{{a }}`, `{{j }}`, `{{u }}`, `{{c }}` are routed through typed runtime stubs so PhpStorm flags wrong argument types (`{{h $array }}`, `{{h $objectWithoutToString }}`, etc.). +- **Composer-aware stub selection**: the strict (Qiq 1.x) or relaxed (Qiq 2.x / 3.x) escape signature is chosen automatically from `composer.lock`. +- **Cross-template rename refactoring**: renaming a PHP property, method, or local variable propagates into every Qiq template that references it. Triggering Shift+F6 from inside a Qiq template (`{{h $article->title }}`) also works. - **Cross-template navigation**: Cmd/Ctrl+click (Go to Declaration) on `setLayout()`, `render()`, `include()`, or custom helpers to open the referenced template file. - **Enter/typing handlers** that auto-complete Qiq block closers and keep indentation consistent. - **Template discovery**: resolves relative paths by walking up from the current file, project roots, and PHP server document roots. +## Settings + +Open **Settings (Preferences) → Languages & Frameworks → Qiq Templates** for project-level options: + +- **Inject `declare(strict_types=1)` into Qiq templates** *(off by default)* — when enabled, scalar literal misuses such as `{{h true }}`, `{{h 123 }}`, or `{{h null }}` surface as PhpStorm type warnings. Useful when your project renders templates under PHP strict types; off by default to match Qiq's runtime, which performs implicit scalar→string casts. + ## Installation The project uses Gradle with the JetBrains IntelliJ Platform Plugin tooling. diff --git a/build.gradle.kts b/build.gradle.kts index 080736b..71079ed 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -53,12 +53,20 @@ intellijPlatform { pluginConfiguration { name.set("Qiq Templates Support") id.set("io.github.jingu.idea-qiq-plugin") - version.set("0.5.0") + version.set("0.6.0") ideaVersion { sinceBuild.set("241") untilBuild.set("261.*") } - description.set("Syntax highlighting and simple navigation for Qiq templates") + description.set( + "Qiq template support for PhpStorm: HTML-aware syntax highlighting, full PHP " + + "injection inside Qiq tags and inline blocks, cross-template rename " + + "refactoring (Shift+F6 works both from PHP and from inside templates), and " + + "type-checked escape directives — wrong types passed to {{h }}, {{a }}, " + + "{{j }}, {{u }}, {{c }} are flagged at edit time by PhpStorm's own Type " + + "Compatibility inspection, with strict / relaxed signatures auto-selected " + + "from composer.lock." + ) vendor { name.set("Yoshitaka Jingu") url.set("https://github.com/jingu/idea-php-qiq-plugin") diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 9f038b7..b8cc784 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -40,6 +40,8 @@ + + @@ -76,8 +78,6 @@ id="settings.qiq" key="settings.qiq.display.name" bundle="messages.QiqBundle"/> - - @@ -93,9 +93,21 @@ -
  • PhpStorm 2026.1 Support +
  • Type-aware escape directives +
      +
    • {{h }}, {{a }}, {{j }}, {{u }}, {{c }} are routed through typed runtime stubs so PhpStorm flags wrong argument types (arrays, objects without __toString, etc.).
    • +
    • The strict (Qiq 1.x) or relaxed (Qiq 2.x / 3.x) escape signature is selected automatically from composer.lock.
    • +
    +
  • +
  • Cross-template rename refactoring +
      +
    • Renaming a PHP property, method, or local variable now propagates into Qiq template references.
    • +
    • Shift+F6 triggered from inside a Qiq template (e.g. on title in {{h $article->title }}) opens the rename dialog and updates both the PHP declaration and every template usage.
    • +
    +
  • +
  • Strict Types setting
      -
    • Extended compatibility to PhpStorm 2026.1 (build 261).
    • +
    • New project setting under Settings > Languages & Frameworks > Qiq Templates that injects declare(strict_types=1) into Qiq templates so scalar literal misuses such as {{h true }} or {{h 123 }} surface as type warnings. Off by default.