Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 08:22 Go to next message
Florent HAZARD is currently offline Florent HAZARDFriend
Messages: 2
Registered: July 2016
Junior Member
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 12:13]

Report message to a moderator

Re: [Feature] Code-assist : Get class name as string [message #1738496 is a reply to message #1737310] Wed, 20 July 2016 10:56 Go to previous messageGo to next message
Dawid Pakula is currently offline Dawid PakulaFriend
Messages: 232
Registered: March 2013
Senior Member
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 12:12 Go to previous message
Florent HAZARD is currently offline Florent HAZARDFriend
Messages: 2
Registered: July 2016
Junior Member
Since I updated to neon, this is working.
Previous Topic:xdebug + LD_LIBRARY_PATH
Next Topic:Xdebug cannot remote debug
Goto Forum:
  


Current Time: Sun Jun 24 02:01:25 GMT 2018

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

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

Back to the top