Pokazywanie postów oznaczonych etykietą PDT. Pokaż wszystkie posty
Pokazywanie postów oznaczonych etykietą PDT. Pokaż wszystkie posty

piątek, 14 stycznia 2011

Eclipse PDT most useful shortcuts

Today I would like to share and keep for the future couple of tricks I found out today after years of working with Eclipse (shame - I know ;).

Incremental search (Ctrl+J)


First of all if you miss "/" command of your favourite vi editor the Ctrl+J is what you need. Once you type pharse you looking for (look at status bar - red color surprisingly means "sorry no match"). But if you are lucky "Up/Down" key buttons allow you navigate back and forth among all found matches (b/n for vi masters ;>).

Open Type (Ctrl+Shift+T)


Immortal Ctrl+Shift+T works as well allows you open any Type available in workspace.

Quick Outline (Ctrl+O)


Ctrl+O invoke nice yellow frame with outline view. Local search ability and "Up/Down" keys allow you handy navigation.

sobota, 18 lipca 2009

Eclipse PDT "No completions available"

At the beginning make sure you have successfully added appropriate libraries directory in Project Properties (right click on project root -> Properties -> PHP Include Path (Libraries)). Eg. in case of Zend Framework assuming you extract archive to zf directory, the actual libraries(those in Zend directory) are in "library" subdirectory, thus that is exactly what we need to add to Libraries pane (should be displayed as follows: [path_toextracted_archive]/zf/library).

Sometimes even though you have properly added all libraries, auto-completion still seems does not work. What is the reason? I found that auto-completion tool is quite smart, and basically analyse the context the cursor is in. Context describes where precisely we are (inside class, inside method, just inside tags, etc. The completion engine works in computed context delivered to the user only available in that very context proposals.

Another important issue is that PHP as dynamic language is taught to deliver completion mechanism, especially for code written in "more dynamic" way. In many cases type of the expression can be known at runtime, thus not possible for IDE to know the type without deep analysis of entire application. PDT comes with support from PHPDoc blocks, where user can be told of the this particular method return type.