-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
various OpenRewrite based quick fixes are broken #1126
Comments
Ouch! Thanks for bringing this up. I was just trying this stuff with native image yesterday and thought it is a problem with native image... I suspect now it is something changed in OR dependencies we consume |
test results from trying things in VSCode:
|
So it looks to me like the indentation problem is a problem with the OR recipe, whereas the other issues could be caused by LSP4E dealing with the quick fix selection via the keyboard in a weird way. But this is just guessing. |
If you apply the quickfix for removing public modifier to file it works fine... must be something about my attempt to apply recipe to a subtree of CU... |
Plus the editor taking the enter key press as input (in addition to executing the quick fix) |
The editor consumed return key press is fixed with: 7361713 |
The issue with the indentation is openrewrite/rewrite#3641 |
Should be fixed the 4.20.1 release. Will double-check and if everything is working in RCs close this and open a new issue for the indentation only to fix in OR |
Fixed for 4.20.1. The rest to be addressed in #1135 |
I still get the NullpointerException with Quickfix (Fresh Install of Eclipse 2023-09 and STS 4.20.1 via Marketplace) Edit 2023-11-03 14:08: Tried current nightly (https://dist.springsource.com/snapshot/TOOLS/sts4/nightly/e4.29) and NullpointerException is still thrown.
{
"jsonrpc": "2.0",
"id": "14",
"method": "workspace/executeCommand",
"params": {
"command": "sts.vscode-spring-boot.codeAction",
"arguments": [
"org.openrewrite.rewrite",
{
"recipeId": "org.openrewrite.java.spring.security5.AuthorizeHttpRequests",
"recipeScope": 1.0,
"docUris": [
"file:///[...]MyConfig.java"
],
"label": "Replace with AuthorizeHttpRequestsConfigurer and use \u0027HttpSecurity.authorizeHttpRequests(...) and related types in file",
"typeStubs": [],
"preferred": false
}
]
}
} public class MyConfig
{
@Bean
Customizer<AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry> authorizeHttpRequestsCustomizer()
{ |
@bohni might be an issue with this specific quickfix - I'll have a look |
@bohni Can you paste your entire |
@BoykoAlex I will do on Monday, when I'm back at work. Thx for investigating. |
Edit: Quick fix does only show up, if class is not in default package... package net.bohni;
import java.util.stream.Stream;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
@Configuration
@PropertySource(value= { "classpath:env.properties", "classpath:my-service.properties" }, ignoreResourceNotFound=true)
@EnableAsync
public class MyConfig
{
@Bean
Customizer<AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry> authorizeHttpRequestsCustomizer()
{
return null;
}
} |
It was not marked with the version I ran before. |
I have a code block in a class that looks like this:
The
public
is underlined, the quick fix to remove thepublic
modifier appears (three variants), but executing the first variant to remove the public modifier at this location results in:(the indentation is wrong)
This happens when I execute the quick fix by clicking on it. Executing the quick fix by pressing
Enter
results in an error popup to show up and theEnter
key press to be inserted into the editor:The error on the language server side looks like this:
The
convert autowired field to constructor param
is broken as well, results in weird source code content.All this happens using the latest nightly builds for STS 4.20.1 on Eclipse 4.29. It all works in the 4.20.0 release. I haven't tried the latest nightly builds in VSCode yet.
The text was updated successfully, but these errors were encountered: