Answer the question
In order to leave comments, you need to log in
Why isn't NetBeans IDE autocomplete working?
Decided to try out the NetBeans IDE. So far, everyone likes it. But here I ran into a problem that it does not define all variables and uses autocompletion for them.
There is a config.php file:
<?php
// Автозагрузчик классов
require_once('./config/autoload.php');
$globaluser = new user(1);
?>
<?php
require_once('./config.php');
$globaluser-> // Вот тут нет автозавершения. Т.е. объявленную ранее переменную в приинклуженом файле не видит.
$localuser = new user(1);
$localuser-> // Вот тут все схватывает.
?>
Answer the question
In order to leave comments, you need to log in
I'll answer the question myself. The truth is a crutch solution:
/* @var $globaluser user */
$globaluser->...
The problem is in the code: it's low quality noodles.
How does the IDE need to know which file you include in which?
Therefore, there are two alternatives.
Or continue to shit-code and prescribe /** var */ for variables in files.
Or write good code that will not have global variables and variables with an external context.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question