There are several 'best Eclipse features' topics, with some great information, but there's much that isn't applicable to Zend Studio.
So, Zend Studio users, what are your best timesavers?
Here are a few I use:
ctrl-shift-r: open any file in your workspace
ctrl-F8: tab between perspectives
ctrl-click on variable, class or method: of course, jump to applicable definition
Describing a variable so intellisense knows what it is:
$variable = someFunction(); /* #var $variable Zend_Form_Element */
ctrl-3 gives you a searchable list of all the commands and such available.
ctrl-f6 cycles between open editors
ctrl-shift-t allows you to search for objects
alt-shift-r allows you to rename all the variables with the same name in a given scope
Related
I have project in which I have a package "com.mysite.Entities". Under this package I have several entities: "Class1.java","Class2.java","Class3.java". Currently in the names we don't have the string "Entity". And now I want to find what entities I have in this package. I want to write somewhere the package and as a result to have the 3 classes defined above.
Is this possible in Eclipse?
I don't want to find them with java code. What I need is just in some way to search in Eclipse IDE and to see in the UI that there are 3 classes, which were written under this package and to be able to select one of them and to open it into the Editor Window.
In Search > Java..., enter the search string com.mysite.Entities.*, search for Type and limit to Declarations.
I just started working with doxygen and eclox (eclipse CDT, C++) and love the whole package. There's only one thing I'm really missing: whenever I try to add a \ref to a function, class or variable, I have to manually remember the (fully namespace qualified) name of what I want to refer to.
It would be AWESOME if it was possible to use the (already existing) code completion feature from eclipse to suggest the right function, class, etc.
Like so:
/**
text yadayada bla \ref std::str<ctrl + space here> -> complete to std::string so that doxygen understands the link
*/
Is that possible? I'm actually surprised that I couldn't find anything about this elsewhere. Is everybody really inserting all references manually all the time?
It becomes quite cumbersome when referring to e.g. imed::helmbus::io::subclasses::CAN_Reader
Adding a reference to this should work the same way as when I'm actually coding:
/**
\ref ime<ctrl+space> -> show list of namespaces beginning with 'ime' -> complete to 'imed::'<ctrl+space> -> show list of subnamespaces -> ... -> imed::helmbus::io::subclasses::CAN_<ctrl+space> -> complete to CAN_Reader
*/
Or is there maybe a place somehwere where I can find out how to do this? Or why it's impossible?
Thanks!
Hope this is not a duplicate... It should not since I tried the usual provided fixes.
I'm facing problems with the automated generation of comments for Classes and Methods using Elipse CDT (Juno/3.8, Linux) configured with Doxygen as default Documentation Tool.
I still get empty comments area for methods parameters while typing /** + ENTER :
/**
*
*/
Here is what I already tried without success :
Setting : Windows > Preferences > C/C++ > Editor > Documentation Tool Comments > Doxygen
Setting : Project > Preferences > Enable Project Specific Settings > Doxygen
Both lead to the same result.
Note : not sure about what happened with Eclipse configuration (it used to work fine before). Is that possible that I erased the Doxygen presets (maybe by pressing Windows > Preferences > C/C++ > Code Style > Code Templates > Restore Defaults). In that case how to get it back to Doxygen style ?
EDIT: I've got some new on the subject...
Basically, it was a global change in my project (which actually is a shared library). For some cross-platform portability reasons, I had to add a MACRO before all my classes, like follows :
class LIB_CLASS LabOneOfMyClasses {
public:
...
}
Unfortunately, doing this seems to break CDT's ability to generate smart functions headers (#param, #return, ...). So removing temporarily the MACRO, allows to get ride of this disagreeable behavior. It is annoying and is something I should report to CDT's staff...
Note : In the end, it is handled properly in Doxygen, anyway.
If someone has a brilliant idea, something I missed, about that ?
You can create a compiler abstraction header to solve this issue. Define a custom symbol in eclipse for your build configuration. Go to Project > Properties > C/C++ General > Paths and Symbols > Symbols > GNU C/C++ in eclipse and define a new unique symbol like #__ECLIPSE_CDT__.
Than in the compiler abstraction header you can write the followings:
#ifdef __ECLIPSE_CDT__
# define LIB_CLASS
#else
# define LIB_CLASS <required normal content>
#endif
And if you consistently include this compiler abstraction header into your files than eclipse will expand LIB_CLASS to nothing while your compiler will find and use the proper definition.
Eclipse already has very impressive and useful what I call "source code modifiers" (please suggest a better name).
For example, it has "Quick Fix", "Word Completion", "Externalize Strings" and other functions that modify source code via menu (or key-combination).
Now, I am looking to add my own "source code modifier" function: I would like to:
Highlight (select) an arbitrary string.
Right-click on it
Invoke a menu item that would "translate" that string to a different string, using a function that I wrote (preferably in Java). Similar to "Quick Fix" or "Replace With" currently on the default context menu.
Is this possible in Eclipse?
If so, what do I need to do to accomplish this?
The short answer:
The quick assist will have to modify the AST of the Java code. Essentially you will have to replace a org.eclipse.jdt.core.dom.SimpleName node with one that you want.
The long answer:
The org.eclipse.jdt.ui.quickAssistProcessors extension point enables you to contribute your own Java code quick assists.
To create a new extension for the extension point you need to first provide the required extension in the plugin.xml. For example, JDT defines the following processor
<extension
point="org.eclipse.jdt.ui.quickAssistProcessors">
<quickAssistProcessor
name="%defaultQuickAssistProcessor"
class="org.eclipse.jdt.internal.ui.text.correction.QuickAssistProcessor"
id="org.eclipse.jdt.ui.text.correction.QuickAssistProcessor">
</quickAssistProcessor>
</extension>
(For a description of the individual attributes, please refer to the extension point documentation)
Then you need to create the class that implements the org.eclipse.jdt.ui.text.java.IQuickAssistProcessor interface, and modify the AST in this class. (This class is the same as the one you specified while declaring the extension)
Supplying the right IJavaCompletionProposal
JDT provides the following default implementations for correction proposals that can be used to contribute quick fixes and quick assists.
ChangeCorrectionProposal
CUCorrectionProposal
ASTRewriteCorrectionProposal
If you use an ASTRewrite, you should create an ASTRewriteCorrectionProposal.
ASTView Plugin
This is something that will help you visualize the AST of a Java source file http://www.eclipse.org/jdt/ui/astview/index.php
The right name is 'Quick Assist'. You have to write some code to create your Quick Assists.
I heard you can use phpDoc to help IDE with autocomplete. Can someone show how to use it with Doctrine?
For example, I have a JobTable class that extends Doctrine_Table with a bunch of methods and would like to have autocompletion when i type: Doctrine::getTable('Job')-> ... Is it possible? Is there a way to do it without phpDoc?
phpDoc comments assist autocompletion mechanism because the IDE then knows the types of the parameters.
/**
* #param $foo FudgingBreakingImpl
*/
function doStuff($foo) { ... }
This way, the IDE knows that $foo is of type FudgingBreakingImpl, so it can autocomplete anything related to $foo, e.g. $foo->someMet.
In your example need of your code extending a Doctrine class, your IDE will need to know where that Doctrine code is in order to know what that object looks like.
In Eclipse, this is a matter of having the Doctrine code locally on your machine and telling your Eclipse project's "Build Path" / "Include Path" where to find it.
Unless the IDE is capable of inspecting that Doctrine code, there's no way it can know things your own code is inheriting from the Doctrine class.