1

Lets say I have a Class "Vehicle"

In netbeans, I can type:

Vehicle v = new Vehicle();

When i type "v.", I instantly get a list of all the class functions and fields

But in Eclipse, when I type "v." nothing pops up.

Can someone tell me how to enable this option in Eclipse? Also how can I format my code in eclipse?

Edit: When i Press CTRL+Space, after typing "v.", i get a small window that says "No default Proposals"

Michael Easter
  • 23,733
  • 7
  • 76
  • 107
Shehryar Farooq
  • 115
  • 3
  • 13

5 Answers5

3

Code assist is Ctrl-Space.

http://wiki.eclipse.org/FAQ_What_editor_keyboard_shortcuts_are_available%3F

Danny Thomas
  • 1,879
  • 1
  • 18
  • 32
2

Try pressing Ctrl-space.

Here is a list of shortcuts. In Eclipse, I believe that Ctrl-Shift-L shows many more.

Michael Easter
  • 23,733
  • 7
  • 76
  • 107
  • When i Press CTRL+Space, after typing "v.", i get a small window that says "No default Proposals" – Shehryar Farooq Dec 15 '11 at 21:48
  • Your question is a duplicate of this one: http://stackoverflow.com/questions/908489/eclipse-java-code-completion-not-working . I vote to close your question as duplicate (I have edited it to add this info) – Michael Easter Dec 15 '11 at 22:35
2

The default keyboard shortcut to format code is Ctrl-Shift-F.

For preferences regarding content assist, look at Window - Preferences - Java - Editor - Content assist. The popup may appear automatically, or may appear by typing Ctrl - space. You probably don't see anything appearing because the code isn't valid. Make sure to import the Vehicle class (Ctrl - Shift - O).

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255
1

Hit ctrl + space to get autocompletion

animuson
  • 53,861
  • 28
  • 137
  • 147
suicide
  • 760
  • 4
  • 13
  • 20
0

The default option you have on eclipse is CTRL+SPACE . You can alter the short cut by Go to preferences >General > editor >Keys . There in the left panel you can set whatever shortcut you like . I prefer mostly the default one .

Abhishek Bhandari
  • 613
  • 1
  • 5
  • 16