Require () and include () do not work in Eclipse for code support and autocomplete

I just started using Eclipse PHP.

I finally figured out how to enable code auto-update.

My problem is that when I use require or include, these variables are not displayed in these files.

Example

code1.php

<? $test = 'hi'; ?>

code2.php

<? require('code1.php'); ?>

When I edit code2.php, the $ test variable is not showing in autocomplete (aka code assist)

+3
source share
3 answers

In Eclipse 3.6 with PDT 2.2.1, I was able to solve this problem by selecting:

Window-> Settings-> PHP-> editor-> CodeAssist

" " "".

, .

+1

. . , .

0

To tell eclipse where the files are included, add them under the right mouse button on your project and select "Properties", then add the path to your classes.

0
source

Source: https://habr.com/ru/post/1731605/


All Articles