Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

lsp code action does not respond #8218

Closed
jiehuifang opened this issue Sep 9, 2023 · 1 comment
Closed

lsp code action does not respond #8218

jiehuifang opened this issue Sep 9, 2023 · 1 comment
Labels
C-bug Category: This is a bug

Comments

@jiehuifang
Copy link

jiehuifang commented Sep 9, 2023

Summary

I use Java's lsp server jdtls. When using the code action function, there is no response and an error message appears on the log.

Reproduction Steps

  1. lsp config

    [[language]]
    name = "java"
    auto-format = true
    indent = { tab-width = 4, unit = "    " }
    language-server = { command = "jdtls", args = [
      "--jvm-arg=-javaagent:/Users/wupei/lombok.jar",
      "-date /Users/wupei/.data/jdtls"
      ]}
  2. use lsp code action

Helix log

❯ hx --health java
Configured language server: jdtls
Binary for language server: /usr/local/bin/jdtls
Configured debug adapter: None
Highlight queries: ✓
Textobject queries: ✓
Indent queries: ✘
2023-09-10T00:01:23.476 helix_term::application [DEBUG] received editor event: IdleTimer
2023-09-10T00:01:24.387 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2023-09-10T00:01:24.788 helix_term::application [DEBUG] received editor event: IdleTimer
2023-09-10T00:01:25.264 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2023-09-10T00:01:25.592 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2023-09-10T00:01:25.594 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"context":{"diagnostics":[],"triggerKind":1},"range":{"end":{"character":9,"line":41},"start":{"character":8,"line":41}},"textDocument":{"uri":"file:///Users/wupei/template/template-api/src/main/java/com/fjh/template/Template.java"}},"id":1}
2023-09-10T00:01:25.651 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":"12","method":"workspace/configuration","params":{"items":[{"scopeUri":"file:///Users/wupei/template/template-api/src/main/java/com/fjh/template/Template.java","section":"java.format.tabSize"},{"scopeUri":"file:///Users/wupei/template/template-api/src/main/java/com/fjh/template/Template.java","section":"java.format.insertSpaces"}]}}
2023-09-10T00:01:25.651 helix_term::application [DEBUG] received editor event: LanguageServerMessage((0, MethodCall(MethodCall { jsonrpc: Some(V2), method: "workspace/configuration", params: Map({"items": Array [Object {"scopeUri": String("file:///Users/wupei/template/template-api/src/main/java/com/fjh/template/Template.java"), "section": String("java.format.tabSize")}, Object {"scopeUri": String("file:///Users/wupei/template/template-api/src/main/java/com/fjh/template/Template.java"), "section": String("java.format.insertSpaces")}]}), id: Str("12") })))
2023-09-10T00:01:25.651 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","result":[null,null],"id":"12"}
2023-09-10T00:01:25.652 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2023-09-10T00:01:25.991 helix_term::application [DEBUG] received editor event: IdleTimer
2023-09-10T00:01:26.216 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":1,"result":[{"title":"Assign statement to new field","kind":"refactor.assign.field","diagnostics":[],"command":{"title":"Assign statement to new field","command":"java.apply.workspaceEdit","arguments":[{"changes":{},"documentChanges":[{"textDocument":{"version":null,"uri":"file:///Users/wupei/template/template-api/src/main/java/com/fjh/template/Template.java"},"edits":[{"range":{"start":{"line":34,"character":31},"end":{"line":41,"character":23}},"newText":"\n\n\tprivate static Template template;\n\n    public static void main(String[] args) {\n        Template t \u003d new Template();\n        // t.setName(\"fjh\");\n        // t.setDescription(\"description\");\n        ValidationUtils.validate(t);\n        template \u003d new Template();"}]}]}]}},{"title":"Assign statement to new local variable","kind":"refactor.assign.variable","diagnostics":[],"command":{"title":"Assign statement to new local variable","command":"java.apply.workspaceEdit","arguments":[{"changes":{},"documentChanges":[{"textDocument":{"version":null,"uri":"file:///Users/wupei/template/template-api/src/main/java/com/fjh/template/Template.java"},"edits":[{"range":{"start":{"line":41,"character":8},"end":{"line":41,"character":23}},"newText":"Template template \u003d new Template();"}]}]}]}},{"title":"Add Javadoc for \u0027main\u0027","kind":"quickassist","command":{"title":"Add Javadoc for \u0027main\u0027","command":"java.apply.workspaceEdit","arguments":[{"changes":{},"documentChanges":[{"textDocument":{"version":null,"uri":"file:///Users/wupei/template/template-api/src/main/java/com/fjh/template/Template.java"},"edits":[{"range":{"start":{"line":36,"character":4},"end":{"line":36,"character":4}},"newText":"/**\n     * @param args\n     */\n    "}]}]}]}},{"title":"Generate Getters","kind":"source.generate.accessors","diagnostics":[],"command":{"title":"Generate Getters","command":"java.apply.workspaceEdit","arguments":[{"changes":{"file:///Users/wupei/template/template-api/src/main/java/com/fjh/template/Template.java":[{"range":{"start":{"line":42,"character":5},"end":{"line":42,"character":5}},"newText":"\n\n\tpublic static long getSerialversionuid() {\n\t\treturn serialVersionUID;\n\t}"}]}}]}},{"title":"Sort Members for \u0027Template.java\u0027","kind":"source.sortMembers","diagnostics":[],"command":{"title":"Sort Members for \u0027Template.java\u0027","command":"java.apply.workspaceEdit","arguments":[{"changes":{"file:///Users/wupei/template/template-api/src/main/java/com/fjh/template/Template.java":[{"range":{"start":{"line":28,"character":4},"end":{"line":42,"character":5}},"newText":"public static void main(String[] args) {\n        Template t \u003d new Template();\n        // t.setName(\"fjh\");\n        // t.setDescription(\"description\");\n        ValidationUtils.validate(t);\n        new Template();\n    }\n\n    @ApiModelProperty(\"Template Module Name\")\n    @NotNull(message \u003d \"name is require\")\n    private String name;\n\n    @ApiModelProperty(\"Template Module Description\")\n    @NotNull(message \u003d \"description is require\")\n    private String description;"}]}}]}},{"title":"Change modifiers to final where possible","kind":"source.generate.finalModifiers","diagnostics":[],"command":{"title":"Change modifiers to final where possible","command":"java.apply.workspaceEdit","arguments":[{"changes":{},"documentChanges":[{"textDocument":{"version":null,"uri":"file:///Users/wupei/template/template-api/src/main/java/com/fjh/template/Template.java"},"edits":[{"range":{"start":{"line":36,"character":28},"end":{"line":37,"character":8}},"newText":"final String[] args) {\n        final "}]}]}]}}]}
2023-09-10T00:01:26.216 helix_lsp::transport [INFO] <- [{"command":{"arguments":[{"changes":{},"documentChanges":[{"edits":[{"newText":"\n\n\tprivate static Template template;\n\n    public static void main(String[] args) {\n        Template t = new Template();\n        // t.setName(\"fjh\");\n        // t.setDescription(\"description\");\n        ValidationUtils.validate(t);\n        template = new Template();","range":{"end":{"character":23,"line":41},"start":{"character":31,"line":34}}}],"textDocument":{"uri":"file:///Users/wupei/template/template-api/src/main/java/com/fjh/template/Template.java","version":null}}]}],"command":"java.apply.workspaceEdit","title":"Assign statement to new field"},"diagnostics":[],"kind":"refactor.assign.field","title":"Assign statement to new field"},{"command":{"arguments":[{"changes":{},"documentChanges":[{"edits":[{"newText":"Template template = new Template();","range":{"end":{"character":23,"line":41},"start":{"character":8,"line":41}}}],"textDocument":{"uri":"file:///Users/wupei/template/template-api/src/main/java/com/fjh/template/Template.java","version":null}}]}],"command":"java.apply.workspaceEdit","title":"Assign statement to new local variable"},"diagnostics":[],"kind":"refactor.assign.variable","title":"Assign statement to new local variable"},{"command":{"arguments":[{"changes":{},"documentChanges":[{"edits":[{"newText":"/**\n     * @param args\n     */\n    ","range":{"end":{"character":4,"line":36},"start":{"character":4,"line":36}}}],"textDocument":{"uri":"file:///Users/wupei/template/template-api/src/main/java/com/fjh/template/Template.java","version":null}}]}],"command":"java.apply.workspaceEdit","title":"Add Javadoc for 'main'"},"kind":"quickassist","title":"Add Javadoc for 'main'"},{"command":{"arguments":[{"changes":{"file:///Users/wupei/template/template-api/src/main/java/com/fjh/template/Template.java":[{"newText":"\n\n\tpublic static long getSerialversionuid() {\n\t\treturn serialVersionUID;\n\t}","range":{"end":{"character":5,"line":42},"start":{"character":5,"line":42}}}]}}],"command":"java.apply.workspaceEdit","title":"Generate Getters"},"diagnostics":[],"kind":"source.generate.accessors","title":"Generate Getters"},{"command":{"arguments":[{"changes":{"file:///Users/wupei/template/template-api/src/main/java/com/fjh/template/Template.java":[{"newText":"public static void main(String[] args) {\n        Template t = new Template();\n        // t.setName(\"fjh\");\n        // t.setDescription(\"description\");\n        ValidationUtils.validate(t);\n        new Template();\n    }\n\n    @ApiModelProperty(\"Template Module Name\")\n    @NotNull(message = \"name is require\")\n    private String name;\n\n    @ApiModelProperty(\"Template Module Description\")\n    @NotNull(message = \"description is require\")\n    private String description;","range":{"end":{"character":5,"line":42},"start":{"character":4,"line":28}}}]}}],"command":"java.apply.workspaceEdit","title":"Sort Members for 'Template.java'"},"diagnostics":[],"kind":"source.sortMembers","title":"Sort Members for 'Template.java'"},{"command":{"arguments":[{"changes":{},"documentChanges":[{"edits":[{"newText":"final String[] args) {\n        final ","range":{"end":{"character":8,"line":37},"start":{"character":28,"line":36}}}],"textDocument":{"uri":"file:///Users/wupei/template/template-api/src/main/java/com/fjh/template/Template.java","version":null}}]}],"command":"java.apply.workspaceEdit","title":"Change modifiers to final where possible"},"diagnostics":[],"kind":"source.generate.finalModifiers","title":"Change modifiers to final where possible"}]
2023-09-10T00:01:26.217 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2023-09-10T00:01:27.095 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2023-09-10T00:01:27.278 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2023-09-10T00:01:27.476 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2023-09-10T00:01:27.659 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2023-09-10T00:01:28.557 helix_term::commands::lsp [DEBUG] code action: CodeAction { title: "Assign statement to new local variable", kind: Some(CodeActionKind("refactor.assign.variable")), diagnostics: Some([]), edit: None, command: Some(Command { title: "Assign statement to new local variable", command: "java.apply.workspaceEdit", arguments: Some([Object {"changes": Object {}, "documentChanges": Array [Object {"edits": Array [Object {"newText": String("Template template = new Template();"), "range": Object {"end": Object {"character": Number(23), "line": Number(41)}, "start": Object {"character": Number(8), "line": Number(41)}}}], "textDocument": Object {"uri": String("file:///Users/wupei/template/template-api/src/main/java/com/fjh/template/Template.java"), "version": Null}}]}]) }), is_preferred: None, disabled: None, data: None }
2023-09-10T00:01:28.557 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"workspace/executeCommand","params":{"arguments":[{"changes":{},"documentChanges":[{"edits":[{"newText":"Template template = new Template();","range":{"end":{"character":23,"line":41},"start":{"character":8,"line":41}}}],"textDocument":{"uri":"file:///Users/wupei/template/template-api/src/main/java/com/fjh/template/Template.java","version":null}}]}],"command":"java.apply.workspaceEdit"},"id":2}
2023-09-10T00:01:28.559 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2023-09-10T00:01:28.562 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":2,"error":{"code":-32601,"message":"No delegateCommandHandler for java.apply.workspaceEdit"}}
2023-09-10T00:01:28.562 helix_lsp::transport [ERROR] <- MethodNotFound: No delegateCommandHandler for java.apply.workspaceEdit
2023-09-10T00:01:28.562 helix_term::commands::lsp [ERROR] execute LSP command: protocol error: MethodNotFound: No delegateCommandHandler for java.apply.workspaceEdit
2023-09-10T00:01:30.276 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2023-09-10T00:01:30.676 helix_term::application [DEBUG] received editor event: IdleTimer
2023-09-10T00:01:30.751 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2023-09-10T00:01:30.962 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2023-09-10T00:01:31.085 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0
2023-09-10T00:01:31.418 helix_view::document [DEBUG] id 2 modified - last saved: 0, current: 0

Platform

macos

Terminal Emulator

alacritty

Helix Version

helix 23.05 (7f5940b)

@jiehuifang jiehuifang added the C-bug Category: This is a bug label Sep 9, 2023
@gabydd
Copy link
Member

gabydd commented Sep 9, 2023

I think this is: #5421

@helix-editor helix-editor locked and limited conversation to collaborators Sep 9, 2023
@the-mikedavis the-mikedavis converted this issue into discussion #8219 Sep 9, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

2 participants