Skip to content

Content Assist

Martin Lippert edited this page Apr 17, 2019 · 4 revisions

Code templates

Write Spring code with templates, available via regular code completion.

Examples

  • @GetMapping
  • @PostMapping
  • @PutMapping
  • @RequestMapping

Smart code completions

Additional code completions for Spring-specific annotations

Examples

  • @Value: code completion for Spring Boot property keys
  • @Scope: code completion for standard scope names

Content assist for Spring XML config files (new in 4.2.1)

Starting with Spring Tools version 4.2.1, the tooling features content-assist code completions within Spring XML config files.

Note: this early implementation is extremely limited and just a starting point, more will follow in subsequent versions of the tooling. If you are looking for something specific, please file an enhancement request as a new GitHub issue in this project.

content-assist for types

This content-assist helps you to pick a type (class or interface) when working with Spring XML config files. The supported elements are (the <*> marks the cursor position for which the tooling offers content-assist):

  • <bean id="theBean" class="<*>"/>

The content-assist for types does not yet support package prefixes and works in class names only.

content-assist for property names

This content-assist helps you to identify properties of beans for which you would like to define an injection:

  • <property name="<*>" ref="theOtherBean"/>

The content-assist can identify property names only in case the class attribute of the parent element is defined and existing. At the moment, only properties with setter methods are recognized, and only in the concrete bean class. Super types are not taken into account yet.

content-assist for bean references

This content-assist helps you to refer to beans that are defined in the same or another Spring XML config file or via the various annotations. It uses the same information as the navigation to beans with the symbol @+.

  • <property name="dependency" ref="<*>"/>

At the moment all bean IDs are listed as proposals that are known from the workspace. This doesn't filter out bean IDs that are outside of the project or its dependencies yet. And the content-assist doesn't propose beans that are defined inside of libraries (JAR files or JMOD modules).

Clone this wiki locally