"@this.call" recognizes javascript "this". How to disable?

I have a custom live template for javascript which I configured as follows:


NAME                  DEFAULT VALUE

COMPONENT     "partials.componentname"

DATA                   ", ['data' => $data]"


The problem is that my IDE recognises the "this" in "@this.call" as a "function (): void" and it also gives an error with "statement expected" in the IDE. How can I disable this inspection for my live template?


What expression do you want to get? What is @this here? 


Oksana Chumak 

I'm using a full stack framework called livewire, which allows me to create components (similar to vue) that are able to communicate between JS and PHP (in both directions). One of those features is the ability to execute php code through a "@this.call('component')" in javascript. The problem now is that my Intellij-IDE sees the "this" in the "@this.call" as a javascript thing. The IDE thinks it's a function, but I don't want it to recognize it as one. I setup a custom live template, which works great, but the problem is that the IDE wants me to add a {}-declaration to my line, because of the "this". I want to disable this specific inspection, it would be even better if the @-symbol removes that inspection.

"this" should NOT be a function. It should not expect a declaration


I guess some specific support for this framework might be required. If it's a plain JS code, then it's expected that the IDE is trying to parse that in a JS way, it's not an inspection, it looks like a parser error to me. 


Also formats the code without an indent...


Please attach a self-contained code sample. Is it still about livewire?


Yes, livewire. Its just javascript inside *.php file.


There is no Livewire support by default. You can try this plugin: https://plugins.jetbrains.com/plugin/13441-laravel-idea


Please sign in to leave a comment.