-
Notifications
You must be signed in to change notification settings - Fork 456
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
Code action 'Create method...' does not work #3780
Comments
Screencast.from.2024-09-26.08-52-55.mp4Seems to be working for me. @loralei28 , @testforstephen what am I missing here. Also, if you activate Could definitely see it being a regression of eclipse-jdtls/eclipse.jdt.ls#3229 though. |
I reproduced this issue, it seems like it's Windows-specific |
Here is a sample file: package functions;
import io.quarkus.funqy.Funq;
/**
* Your Function class
*/
public class Function {
/**
* Use the Quarkus Funqy extension for our function. This function simply echoes its input
* @param input a Java bean
* @return a Java bean
*/
@Funq
public Output function(Input input) {
// Add business logic here
bar();
return null;
}
} Here is a trace of what the server returns for the quickfix: [Trace - 10:45:24 AM] Received response 'codeAction/resolve - (119)' in 5ms.
Result: {
"title": "Create method 'bar()'",
"kind": "quickfix",
"diagnostics": [
{
"range": {
"start": {
"line": 18,
"character": 8
},
"end": {
"line": 18,
"character": 11
}
},
"severity": 1,
"code": "67108964",
"source": "Java",
"message": "The method bar() is undefined for the type Function"
}
],
"edit": {
"changes": {},
"documentChanges": [
{
"textDocument": {
"version": null,
"uri": "file:///C:/Users/david/Documents/Programming/TestProjects/quarkus-func/src/main/java/functions/Function.java"
},
"edits": [
{
"snippet": {
"value": "${1:bar}();\n\n return null;\n }\n\n ${2|private,public,protected|} ${3:void} ${1:bar}() {\n // TODO Auto-generated method stub\n throw new UnsupportedOperationException(\"Unimplemented method 'bar'\");\n }"
},
"range": {
"start": {
"line": 18,
"character": 8
},
"end": {
"line": 21,
"character": 5
}
},
"newText": ""
}
]
}
]
},
"command": {
"title": "refresh Diagnostics",
"command": "java.project.refreshDiagnostics",
"arguments": [
"file:///c%3A/Users/david/Documents/Programming/TestProjects/quarkus-func/src/main/java/functions/Function.java",
"thisFile",
false,
true
]
}
} |
I'm seeing the exact same response, only file URI is different (I'm on Linux). When you have time, i would try to validate whether --- yours.txt 2024-09-26 11:17:54.751100419 -0400
+++ mine.txt 2024-09-26 11:23:02.727259008 -0400
@@ -1,4 +1,4 @@
-[Trace - 10:45:24 AM] Received response 'codeAction/resolve - (119)' in 5ms.
+[Trace - 11:22:36] Received response 'codeAction/resolve - (458)' in 39ms.
Result: {
"title": "Create method 'bar()'",
"kind": "quickfix",
@@ -26,7 +26,7 @@
{
"textDocument": {
"version": null,
- "uri": "file:///C:/Users/david/Documents/Programming/TestProjects/quarkus-func/src/main/java/functions/Function.java"
+ "uri": "file:///home/rgrunber/sample-projects/my-quarkus-example/src/main/java/functions/Function.java"
},
"edits": [
{
@@ -53,7 +53,7 @@
"title": "refresh Diagnostics",
"command": "java.project.refreshDiagnostics",
"arguments": [
- "file:///c%3A/Users/david/Documents/Programming/TestProjects/quarkus-func/src/main/java/functions/Function.java",
+ "file:///home/rgrunber/sample-projects/my-quarkus-example/src/main/java/functions/Function.java",
"thisFile",
false,
true
Definitely seems like something on the client side that's treated differently. Update: Maybe the LSP text document URI is slightly different than the converted to VS Code text document URI ? Line 334 in 29329d8
|
Looks like |
Hello. After upgrading the extension to version 1.35.0 in Windows 11 environment, Create local Variable '???' does not work properly. However, there was no problem in Ubuntu 22.04 environment. Windows 11 + Ext Ver. 1.35.0 (It became "") win-do-not-work-create-val.mp4Ubuntu 22.04 + Ext Ver. 1.35.0 ubuntu-do-work-create-val.mp4 |
@testforstephen , can you try the PR and let me know if it resolves it for you ? It should prevent If someone could try out java-win32-x64-1.36.0-179.vsix (on windows) from https://github.com/rgrunber/vscode-java/releases/tag/v1.36.0 and let me know if that fixes things for them, that would help. |
@testforstephen , I think we should just disable the feature ( |
+1 |
I found the root cause on Windows. It's our code : Line 334 in 0149fc7
URI from the language server is : The conversion seems to be done by the We can probably fix this by calling Could someone try out https://github.com/rgrunber/vscode-java/releases/tag/v1.36.0 . It should contain a new vsix there that should work on Windows. |
@rgrunber It seems to be working: indentation-bug-linked-editing.mp4There's a bug related to the indentation of the inserted content. At the end of the video I formatted the document manually and the content seems to be correct after that |
This is microsoft/vscode#63129 |
The v1.35.1 release yesterday worked well in a Windows environment. Thank you for your support. 👍 |
Why it took so long to fix😡 |
@iwangbowen I guess you get what you paid for |
1.35.0 was released on September 26th (Thursday). I think we were aware of the issue prior to release but didn't have enough information. The feature was available for about 20 days in the 1.35.0 pre-releases so had it been filed earlier, we probably could have fixed it well before the release. We were investigating the problem the day of the release and by the next day, we decided it would be better to revert and see if we can re-enable for 1.36.0. We had a bug fix release (1.35.1) on Monday (30th). |
Environment
Steps To Reproduce
class
andmain
code snippet to generate codebar();
Current Result
”Create method 'bar()'“ does not work and will delete "bar()"
The text was updated successfully, but these errors were encountered: