开发者

eclipse autocompletion from class file?

开发者 https://www.devze.com 2022-12-13 08:19 出处:网络
when i use netbeans and includes a class in a phpfile and then开发者_JAVA技巧 type $class_name-> it will show all functions and properties of that class.

when i use netbeans and includes a class in a phpfile and then开发者_JAVA技巧 type $class_name-> it will show all functions and properties of that class.

how can i do that with eclipse?


The CTRL+Space should work, but I would recommend a recent eclipse and PDT.

At the beginning of PDT, there used to be some completion issues like bug 167626, but they are fixed by now.
Do indicate to eclipse what Php you are using (4? 5? see this thread), and make sure your project is opened as a Php one (see this thread)


Code completion in PDT works when Eclipse can understand what is the target class. In some cases this can be derived from the code (e.g. when you have a variable which is assigned an instantiation of a class). In other cases, it is derived from PHPDoc comments which denote the type of vars and arguments, method return types, etc.

See this article for example.

In any event using $class_name-> makes no sense. You need to use a variable name and, in case the variable is recognized as a type, you will get the complete list of methods/field.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号