Hi All,
Here are some tips how to improve your development speed by utilizing some of the features in Eclipse.
Key combination to use within Eclipse:
- Control-Shift-L: Locates/searches for any servoy resource you have, and opens the editor
- Control-L: shows a popup where you can type the linenumber you want to jump to
- Control-Shift-F: Formats you (selected) code
- Control-/: toggles commenting
- Control-H: shows a search screen to search all the files in your workspace
- Control - Space: Trigger code completion
- Control - O: Quick Outline in the javascript editor to quickly jump to another method/variable
Help->Key Assist: Shows you all the available key combinations
Problems View:
Inside Eclipse there is a View called Problems and it shown you both Warnings and Errors. Errors are off course more serious than warnings. If something isn't working, check if there are any related Errors or Warnings in your workspace and fix them first. Some of the entries support the Quick Fix option in the rightClick contextual menu if you rightClick the entry.
View the same Resource (Form, sourceCode) multiple times:
You can Rightclick editor tabs to open the same resource again in a new editor: RightClick the editor tab and select New Editor. Then you can drag the new tab around, for example to the bottom of the existing Editor, effectively creating a split view. For example handy when refactoring code.
Add task:
Eclipse allows you to add tasks to your code, without placing them as comments withing your code. Just go to the line of code where you want to add the task and select Edit - Add task from the menuBar. All your tasks are accessible through the Tasks view.
Bookmarks:
Eclipse allows you to create bookmarks for yourself in your code. Just go to the line of code you want to bookmark and select Edit - Add bookmark from the menuBar. All your bookmarks are accessible through the Bookmarks view.
Local history:
Eclipse saves all the changes you make in your code (up to a certain configurable limit (Window - Preferences - General - Workspace - Local History)) and you can have a look at them, by rightClicking your sourcecode and select Compare with - Local History. This will activate the history view in Eclipse. there you will see all the local revisions of your source code file. Select 2 of them by control-clicking and then rightclick the selection to open the two revisions in a Compare Editor. Note: the same mechanism is available when you use SVN or CVS for remote history.
Folding
Window - Preferences - JavaScript - Editor - Folding: Gives you the option to enable folding of Comments, possible making it easier to read code.
Templates
Window - Preferences - JavaScript - Editor - Templates: When you find yourself typing or copy-pasting the same block of code or comment everytime, use this option to create a new template for yourself. The template is then accessible through Code Completion (Control-Space).
If you have any Eclipse tips yourself, please post them here!
Regards,
Paul