Reputation: 2023
I want some nested JSON like var for some configuration.
In JavaScript, the obj, PhpStorm can show candidate properties:
const ABC = {
A1: 123,
A2: [
B1: 33,
B2: 44
]
}
// after type each dot `.`, PhpStorm can show candidate properties
console.log(ABC.A2.B1)
But not working for PHP, PhpStorm can only show candidate for the first level of the array, not for deeper array, and doesn't show error tips if index not exist:
<?php
class TT
{
const ABC = [
'A1' => 123,
'A2' => [
'B1' => 123,
'B2' => 5566
]
];
public function f1()
{
// PhpStorm can only show candidate for the first level of the array
// not for deeper array
echo self::ABC['A2']['B1'];
// not show error tips for not exist index
echo self::ABC['A12345']['B1'];
}
}
Upvotes: 0
Views: 267
Reputation: 165138
ATM code completion works for 1st level array keys only.
Accordingly to devs such tracking and completion (even for 1st level array keys) is a bit resource-intensive operation.
https://youtrack.jetbrains.com/issue/WI-6845 -- watch this ticket (star/vote/comment) to get notified on any progress.
Upvotes: 1