Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Code Assist not working for PHP language functions(Code Assist not working for PHP language functions like strstr, ereg_replace etc.)
Code Assist not working for PHP language functions [message #486493] Thu, 17 September 2009 16:41 Go to next message
No real name is currently offline No real name
Messages: 2
Registered: September 2009
Junior Member
Hi

I have "Eclipse for PHP Developers Build id: 20090619-0625" with Aptana plugin.

Code Assist not working forme for PHP built in language functions like strstr, ereg_replace etc. is not working for me on Ctrl+Space.

what I mean:
when I type , for example, "strstr" in a php file, in php perspective and click Ctrl+space , I expect a dropdown suggestion box with options like "strstr", "strpos" etc. to appear with syntax like:
strstr  ( string $haystack  , mixed $needle  [, bool $ strin_needle = false  ] )


this doesn't happen.
instead I get a red text message "No completions available" at the status bar.

However if I type "e" and hit Crtl+Space I get a drop down with "ec" I get a drop down of 2 options: "echo" and "eco - echoro string".

also if I type "strstr" and highlight it , right click it and choose "Open PHP manual" from the context menu or hit Shift+f2 - nothing happens.
in Prefences -> "PHP"->"PHP manual" I have 1 listing:
Site Name="PHP URL=http://www.php.net/manual/en/, file Extension= php

if however I create a class with methods, and then create a new instance of the class and start typing the name of the method - I do get a suggestion box of the method that can complete that function with properties and everything - so this part does work.
Re: Code Assist not working for PHP language functions [message #486596 is a reply to message #486493] Fri, 18 September 2009 07:03 Go to previous messageGo to next message
Roy Ganor is currently offline Roy Ganor
Messages: 150
Registered: July 2009
Senior Member
Do you see the language entry in the .buildpath file?
If you create a new project and compare your two .buildpath files (under
the project root) you'll see what I mean.

Roy
<barefootfemale@hotmail.com> wrote:

> Hi

> I have "Eclipse for PHP Developers Build id: 20090619-0625" with Aptana
plugin.

> Code Assist not working forme for PHP built in language functions like
strstr, ereg_replace etc. is not working for me on Ctrl+Space.

> what I mean:
> when I type , for example, "strstr" in a php file, in php perspective and
click Ctrl+space , I expect a dropdown suggestion box with options like
"strstr", "strpos" etc. to appear with syntax like:
> strstr ( string $haystack , mixed $needle [, bool $ strin_needle = false
] )

> this doesn't happen.
> instead I get a red text message "No completions available" at the status
bar.

> However if I type "e" and hit Crtl+Space I get a drop down with "ec" I get
a drop down of 2 options: "echo" and "eco - echoro string".

> also if I type "strstr" and highlight it , right click it and choose "Open
PHP manual" from the context menu or hit Shift+f2 - nothing happens.
> in Prefences -> "PHP"->"PHP manual" I have 1 listing:
> Site Name="PHP URL=http://www.php.net/manual/en/, file Extension= php

> if however I create a class with methods, and then create a new instance of
the class and start typing the name of the method - I do get a suggestion box
of the method that can complete that function with properties and everything -
so this part does work.
Re: Code Assist not working for PHP language functions [message #486612 is a reply to message #486596] Fri, 18 September 2009 08:01 Go to previous messageGo to next message
No real name is currently offline No real name
Messages: 2
Registered: September 2009
Junior Member
Roy Ganor wrote on Fri, 18 September 2009 07:03
Do you see the language entry in the .buildpath file?
If you create a new project and compare your two .buildpath files (under
the project root) you'll see what I mean.

Roy




I'm not using eclipse for any project at the moment, just editing a php file here and there.

but anyway, I now opened a project and this is what I have in the .buildpath file:

<?xml version="1.0" encoding="UTF-8"?>
<buildpath>
	<buildpathentry kind="src" path=""/>
	<buildpathentry kind="con" path="org.eclipse.dltk.USER_LIBRARY/lib"/>
</buildpath>


EDIT: you were basically right on the spot
I added this line:
	<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>


and now it works now for the project.
but how do I make this work for every PHP file that I edit on every new project and for every PHP file that is NOT a part of project ?

[Updated on: Fri, 18 September 2009 08:08]

Report message to a moderator

Re: Code Assist not working for PHP language functions [message #491261 is a reply to message #486612] Tue, 13 October 2009 16:20 Go to previous messageGo to next message
No real name is currently offline No real name
Messages: 2
Registered: October 2009
Junior Member
I have exactly the same problem. Everything works fine when using php project (library is in PHP Language library)
but when I quick edit file directly on server (through RSE) I have no code completion other than variables
and functions declared in file. It worked perfectly on Eclipse 3.3.2. and PTD 1.0.3.
and now on Galileo SR1 (3.5.3) and PDT 2.2.0 (also on 2.0.0) it doesn't work.

Hopefully someone will face this issue and help us, since adjustments for small, one-person projects
are far more efficient when making them on server rather than locally, and uploading each time
you want to check if production server will react in the same way as your local debugger.

[Updated on: Tue, 13 October 2009 16:22]

Report message to a moderator

Re: Code Assist not working for PHP language functions [message #494317 is a reply to message #491261] Fri, 30 October 2009 05:30 Go to previous messageGo to next message
beono  is currently offline beono
Messages: 3
Registered: October 2009
Junior Member
Quote:
quick edit file directly on server (through RSE) I have no code completion other than variables
and functions declared in file


I have the same problem Sad
Did you find solution?
Aptana plugin can help, but i like PDT for php coding.
Re: Code Assist not working for PHP language functions [message #494513 is a reply to message #494317] Fri, 30 October 2009 19:47 Go to previous messageGo to next message
No real name is currently offline No real name
Messages: 2
Registered: October 2009
Junior Member
I haven't found it yet - I decided to hold two separate eclipse installations - the old one which gave me possibility to change files with RSE and code completion for functions, and the new one for my projects developed in php 5+ and debugged locally.

Simply had to switch my way of working to local developement and rare updates on production server. While it's perceived as better solution to develop and debug locally, store code in repo etc. I still prefer remote changing availability, since I can hold my eclipse on USB stick/drive, and make some adjustments for production projects any time from any PC and I don't have to do it on my PC with apache/php installed and projects stored. Yes, it's not a mature attitude to project developement but it's extremely rapid and my response to client needs is "2 seconds" faster and those 2 seconds really count, when your site is not working properly and marketing campaign for few hundreds of thousands dollars/euros/whatever wants people to type it in address bar Wink

Still hoping that some eclipse-master will show us how to solve this.

[Updated on: Fri, 30 October 2009 19:48]

Report message to a moderator

Re: Code Assist not working for PHP language functions [message #495017 is a reply to message #494513] Tue, 03 November 2009 09:47 Go to previous messageGo to next message
beono  is currently offline beono
Messages: 3
Registered: October 2009
Junior Member
I FIXED IT!!!!!!!!!!!!!

In short:

open your workspace (example \Documents and Settings\user\workspace\)

now you need to copy some files (.buildpath, /.settings/org.eclipse.php.core.prefs)

from any php project to RemoteSystemsTempFiles folder.

in other words PDT try to find library path in RSE folder when you editing file as php, so you should copy some special files from any php project

Re: Code Assist not working for PHP language functions [message #823155 is a reply to message #495017] Sat, 17 March 2012 17:58 Go to previous message
Ju Ka is currently offline Ju Ka
Messages: 1
Registered: March 2012
Junior Member
Step 8: Fixing PHP autocomplete with Remote System Explorer
( patrickjwaters dot com/blog/2011-07-24/how-setup-eclipse-php-pdt-remote-system-explorer-theme-manager-and-drupal-plugins/35 )

The last step is fixing the php autocomplete feature. To do this you are going to have edit a hidden file in your workspace folder. But first we are going to enable hidden files on RSE. Go to 'Eclipse > Preferences' (Mac) or 'File > Preferences' (Windows) and then unfold 'Remote Systems > Files'.
Check 'Show Hidden Files' and click ok.

Now we are going to use RSE to edit an eclipse RSE .project file. So in your 'Remote System' tab open up your local files and navigate to you workspace folder. Look for a folder called 'RemoteSystemsTempFiles' and open that. Now you are going to edit the '.project' file. Open up that file.

You are going to add two line in between the <natures> tag, those lines are
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>org.eclipse.php.core.PHPNature</nature>

Save that file and restart eclipse. If you did everything correctly you should now have auto complete that will look like so

//You can see the pictures for this description proceeding on the link
Previous Topic:internal vs. external browser when debugging
Next Topic:Fresh PDT install won't allow editing PHP files
Goto Forum:
  


Current Time: Tue Sep 02 05:11:27 EDT 2014

Powered by FUDForum. Page generated in 0.11629 seconds