Spring Framework Tutorial
Software Setup and Configuration (STS/Eclipse/IntelliJ)
Core Spring
Spring Annotations
Spring Data
Spring JDBC
Spring Security
Code suggestions (or code completion) are invaluable for speeding up the development process, helping with API discovery, and reducing typos. In Eclipse and the Spring Tool Suite (STS, which is built on top of Eclipse), this feature is termed "Content Assist."
To ensure that Content Assist (code suggestion) is enabled and to configure it:
Open Preferences:
Window
> Preferences
if you're on Windows or Linux.Eclipse
or STS
> Preferences
.Navigate to Content Assist Settings:
Java
> Editor
> Content Assist
.Auto Activation:
Enable auto activation
.Auto activation triggers for Java
field defines which characters trigger the content assist. By default, this is set to .abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
, which means the suggestions will pop up when you type any of those characters. You can modify this to suit your preferences.Triggering Content Assist Manually:
Ctrl + Space
(on most configurations). If Content Assist doesn't appear when you expect it to, ensure that this key combination is correctly set:General
> Keys
.Additional Suggestions:
Java
> Editor
> Content Assist
section, you can click on the Advanced
button to configure which types of suggestions you want to be shown and in which order. Here, you can ensure that classes, templates, keywords, etc., are all included in the Content Assist suggestions.Save & Close:
Apply
and then OK
to save any changes and close the Preferences dialog.With these settings, Content Assist should aid you effectively while coding in Eclipse or STS. If you're still facing issues, consider resetting your Eclipse/STS workspace or creating a new workspace, as sometimes configurations can get muddled in complex projects.