Question

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

Was it helpful?

Solution 3

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.

OTHER TIPS

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!

Eclipse > Preferences > Java > Editor > Content Assistant > Advanced

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

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top