0

I added the sysout in the Eclipse template, context as Java statements and Pattern as System.out.println(${word_selection}${});${cursor} but still when I try typing "sysout" and press Ctrl + Space, it says "No default proposal".

Please help me how to figure this out, I am using MyEclipse version -8.6

JohnEye
  • 6,436
  • 4
  • 41
  • 67
tom
  • 5,114
  • 6
  • 24
  • 36

4 Answers4

4

I had the same problem, but it turned out I was typing a code snippet outside of a method, so Eclipse correctly decided not to propose this template. How silly!

JohnEye
  • 6,436
  • 4
  • 41
  • 67
  • Fml, this answer needs more attention! I was silly too. Addition: if you type something outside a method and hit crtl+space there is a proposal that will autogenerate a void method with this name and no arguments.. – Zuop Mar 07 '17 at 16:05
1
Eclipse > Preferences > Java > Editor > Content Assistant > Advanced

Make sure Template Proposals is checked in one of the shown lists.

Muhammad Gelbana
  • 3,890
  • 3
  • 43
  • 81
0

You shouldn't need to add the template as it should already be there under Java->Editor->Templates. Ensure that you have ticked the checkbox at the beginning of the template definition. Also make sure that you're pressing Ctrl+Space with the text cursor positioned immediately after the "t" in "sysout". This works for me.

Tony Weddle
  • 2,081
  • 1
  • 11
  • 15
  • I have all the teplates setuped correctly, it use to work ofr me in my priveos work place but dont know why it is not working here, I did used this feature for years but now its not working-:( – tom Aug 08 '13 at 13:59
  • Is there anything else i am missing – tom Aug 08 '13 at 13:59
  • 1
    A few things to try. Firstly, try a new workspace; import a project from the old workspace and see if that fixes it - if it does, import any other projects from the old workspace. If not, try adding -clean to the myeclipse.ini file (at the top, after the lead comment), before starting up. If neither of these work, try reinstalling MyEclipse or, better still, install the latest release. – Tony Weddle Aug 10 '13 at 10:29
  • Is there a way to remap the Ctrl+Space to Tab? – Patrick Zawadzki Oct 13 '15 at 14:11
0

In my case, I had the Apache POI library referenced in my project which added the SystemOutLogger to the list of things to insert.

'sysout' will only be auto inserted if it is the only thing in the list.

enter image description here

spencer.sm
  • 19,173
  • 10
  • 77
  • 88