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

1

4 Answers 4

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!

1
  • 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
    Commented Mar 7, 2017 at 16:05
1
Eclipse > Preferences > Java > Editor > Content Assistant > Advanced

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

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.

4
  • 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
    Commented Aug 8, 2013 at 13:59
  • Is there anything else i am missing
    – tom
    Commented Aug 8, 2013 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. Commented Aug 10, 2013 at 10:29
  • Is there a way to remap the Ctrl+Space to Tab? Commented Oct 13, 2015 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

Not the answer you're looking for? Browse other questions tagged or ask your own question.