Skip to content

Content Assist

Martin Lippert edited this page May 21, 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, for example:

  • <bean class="<*>"...

The content-assist supports package prefixes and class names now (new in 4.2.2)

content-assist for packages (new in 4.2.2)

This content-assist helps you to pick a package when working with Spring XML config files, for example:

  • <component-scan base-package="<*>"...

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. (new in 4.2.2) Super types are taken into account now.

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).

(new in 4.2.2): the bean ID content-assist supports now a wide variety of additional XML elements and attributes, but still shows all the bean IDs in your workspace, which might be a bit misleading depending on the exact context. If you come across some wildly misleading proposals, please file an issue and provide an example.

Clone this wiki locally