tom
tom

Reputation: 5514

Sysout shortcut key not working even after setting the template

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

Upvotes: 0

Views: 4300

Answers (4)

spencer.sm
spencer.sm

Reputation: 20614

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

Upvotes: 0

Muhammad Gelbana
Muhammad Gelbana

Reputation: 4010

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

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

Upvotes: 1

JohnEye
JohnEye

Reputation: 6895

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!

Upvotes: 4

Tony Weddle
Tony Weddle

Reputation: 2091

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.

Upvotes: 0

Related Questions