Tio Urso
Tio Urso

Reputation: 101

PhpStorm: AngularJS ng-repeat microSyntax not correctly evaluated by IDE

In PhpStorm 2018.3.4 there is a "Unterminated statement" warning just after the word "data" in the code below:

<tr ng-repeat="data in filteredData = ( tableData |
   filter: { status: filters.status||undefined,
             sequence: filters.sequence||undefined
   }
   | orderBy:orderOpt:orderReverse)"
    ng-class="data.status_class">

The rest of the code is OK, and the code runs smoothly in the browser.

Is there a way to avoid this warning without disabling the "unterminated statement" inspection? Could it be a PhpStorm bug?

The warning is shown only when there is this complex filter + orderby clauses. In simple "item in items" there is no warning.

Unterminated statement warning

Upvotes: 0

Views: 44

Answers (2)

lena
lena

Reputation: 93728

I've logged it as WEB-37641, please vote for this ticket to be notified on any progress with it

Upvotes: 1

Tio Urso
Tio Urso

Reputation: 101

After many tryouts, I concluded that it is a PhpStorm bug. Putting the entire "ng-repeat" syntax in the same line solved the issue.

It is a long line in the middle of the code but it solved my problem.

Upvotes: 0

Related Questions