-
Notifications
You must be signed in to change notification settings - Fork 208
Validations And Quick Fixes
The new version of the Spring Tools 4.17.0 (and the corresponding extensions for VSCode in version 1.41.0) introduces experimental support for a number of Spring specific validations and corresponding quick fixes.
Examples for those validations are:
- field injections (using
@Autowired
on a field) where constructor parameters should be used instead - useless
@Autowired
annotations on constructors that could be removed - the usage of
@RequestMapping
where specific mapping annotations like@GetMapping
should be used instead
Please take a look at the preferences to see the full list of validations that the tools provide.
Since the validations are often related to specific styles or recommendations how to use Spring, they do not necessarily point to real problems or errors. Therefore, you can define the severity of each of these validations individually in the preferences. You can change those preferences to choose the right level for your case - or turn every validation to IGNORE if you don't want to see any those validations to appear.
The tooling uses a new library and an experimental new architecture as a foundation for the new validations and quick fixes, which is based on OpenRewrite. To enable the validations and quick fixes, users need to enable Reconciling for Java sources
in the preferences. In addition to that a prompt asks users for this preference once (for awareness).
Potential side effects of this new experimental foundation can include a much increased memory consumption inside of the language server process that runs side-by-side with your coding environment. If you observe anything like that, you can disable the Reconciling for Java sources
in the preferences again to see if that solves the issue. In addition to that it would be great to report those situations via https://github.com/spring-projects/sts4/issues, and maybe attach a heap dump (if possible), so that we can analyze those situations in more detail.
- Installation (latest release + snapshots)
- User Guide
- Getting Started
- Navigation
- Live Application Information
- Content Assist
- Version Validation
- Upgrade Support
- Validations and Quick Fixes
- WebFlux Support
- Boot Properties Editor
- Boot Dashboard
- Other Editors
- STS3
- Custom VM args
- FAQ
- Changelog
- Known Limitations & Issues
- Report an Issue
- Developer Manual
- Overview
- Language Server Integration into Clients
- Communication with JDT LS
- STS4 Language Server Protocol Extensions