Skip to content

Conversation

@xHeaven
Copy link
Collaborator

@xHeaven xHeaven commented Nov 29, 2025

Closes #20.
Currently only supports variables that exist in the view file in some way, for example as a PHPDoc:

/** @var string $title **/

@github-actions
Copy link

github-actions bot commented Nov 29, 2025

Qodana Community for JVM

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked

View the detailed Qodana report

To be able to view the detailed Qodana report, you can either:

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/qodana-action@v2025.2.1
        with:
          upload-result: true
Contact Qodana team

Contact us at qodana-support@jetbrains.com

@xHeaven
Copy link
Collaborator Author

xHeaven commented Nov 29, 2025

@xepozz This works fine, but something odd is going on. If the template brackets are not wrapped in any HTML element, we are getting no completion whatsoever.

So this works:

<?php
/** @var string $title **/
?>

<body>
    {{ $| }} <!-- getting autocompletion for $title -->
</body>

But this doesn't:

<?php
/** @var string $title **/
?>

{{ $| }} <!-- NOT getting autocompletion for $title -->

Any chance you could take a look on this? The issue is probably not directly caused by this addition, more like the outcome of a bug somewhere else. Even without this feature, non-html-wrapped template variables get no proper completion even if triggered via the IDE's in-built Code | Code Completion | Basic.
I tried to debug this but didn't get too far unfortunately. I'm probably missing something.

@xepozz
Copy link
Collaborator

xepozz commented Dec 2, 2025

image image

@xHeaven the reason it doesn't work is com.intellij.psi.PsiLanguageInjectionHost isn't implemented by any of the tokens itself or it's parents

That's why it should be done by a new templating PSI layer over the original HTML.

Let's merge it and decide how to do it later

@xHeaven xHeaven merged commit f6ea236 into main Dec 2, 2025
6 checks passed
@xHeaven xHeaven deleted the feature/view-autocompletion branch December 2, 2025 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

View autocompletion trigger on writing $

3 participants