Code Completion not working with remote file (with RSE)

三世轮回 提交于 2019-11-30 07:32:39
Olivier

Autocompletion for the PHP project (classes, functions...):

I found that adding the folowing lines to the .project did solve the autocompletion issue for the classes of the PHP project itself but did not work with native PHP functions:

<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>org.eclipse.php.core.PHPNature</nature>

I found a way around it:

Autocompletion for the native PHP functions (print_r()...):

You have to go to your eclipse configuration folder and find the PHP language folder:

In my case: C:\Program Files\EclipseSF2\configuration\org.eclipse.osgi\bundles\276\1\.cp\Resources\language\php5.3

Then you can:

  • right click at the root of your eclipse project,
  • then go to build path
  • link source
  • browse: and link to this folder...

This allows the autocompletion for native PHP function!

Autocompletion for the Symfony framework:

For people using the Symfony framework you can add to your .project file the following lines:

<buildCommand>
        <name>com.dubture.symfony.core.symfonyBuilder</name>
        <arguments>
        </arguments>
</buildCommand>

When using RemoteSystemExplorer, there is a hidden project "RemoteSystemExplorer" in your workspace.

Close eclipse first. I have edited the .project file there and added the line:

<nature>org.eclipse.php.core.PHPNature</nature>

within the Tag <natures>. And added the file .buildpath with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<buildpath>
    <buildpathentry kind="src" path=""/>
    <buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
</buildpath>

Starting eclipse and php autocompletion is working. I have done this workflow with "eclipse Kepler".

Eduardo Cuomo

Solution:

1) Close Eclipse.

2) Go to project path.

3) Open ".buildpath" with text editor (gedit, VIM, notepad, etc).

4) Add next line after "buildpath" line:

<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>

Example:

Before:

<?xml version="1.0" encoding="UTF-8"?>
<buildpath>
    <buildpathentry kind="src" path="library"/>
    <buildpathentry kind="src" path="public"/>
    <buildpathentry kind="src" path="application"/>
</buildpath>

After:

<?xml version="1.0" encoding="UTF-8"?>
<buildpath>
    <buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
    <buildpathentry kind="src" path="library"/>
    <buildpathentry kind="src" path="public"/>
    <buildpathentry kind="src" path="application"/>
</buildpath>

5) Save file and exit!

6) Open Eclipse.

7) WORK!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!