Skip to main content



      Home
Home » Language IDEs » PHP Development Tools (PDT) » [Feature] Code-assist : Get class name as string([CLOSED] Feature request for class name code completion. Working since Neon.)
[Feature] Code-assist : Get class name as string [message #1737310] Thu, 07 July 2016 04:22 Go to next message
Eclipse UserFriend
Hi,

In PHP, we can not pass a class as parameter, so we generally manipulate class name as string, PHP allows it, e.g $class::callMe()

Eclipse PDT is able to complete a class name in PHP Doc or directly in source code but PDT does not seem to be able to complete a class name in a string.
So, it could not complete in every string but maybe in a special mode or whatever... This may really help us to avoid hand-writing.

Thank you for this great IDE !

Other example:
public static function getObjectClass() {
	return '\Namespace\To\My\Class';
}

[Updated on: Wed, 20 July 2016 08:13] by Moderator

Re: [Feature] Code-assist : Get class name as string [message #1738496 is a reply to message #1737310] Wed, 20 July 2016 06:56 Go to previous messageGo to next message
Eclipse UserFriend
PDT already autoassist class names inside string, but only after ctrl+space. Try this: $x = 'MyClass|'; <-- where | is your cursor. PDT suggest classes with MyClass prefix or autoinsert MyClass FQN.

This will not work for prefixes with "\".
Re: [Feature] Code-assist : Get class name as string [message #1738504 is a reply to message #1737310] Wed, 20 July 2016 08:12 Go to previous message
Eclipse UserFriend
Since I updated to neon, this is working.
Previous Topic:xdebug + LD_LIBRARY_PATH
Next Topic:Xdebug cannot remote debug
Goto Forum:
  


Current Time: Wed Jul 16 13:47:21 EDT 2025

Powered by FUDForum. Page generated in 0.26393 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top