Skip to content

Not working -> auto imports, completion, documentation on linux #20

Closed as not planned

Description

@SaiKamalP
  1. Suggestions are shown, but nothing is added as import on hitting enter, only the word is completed.
Screencast.From.2024-11-12.01-07-57.mp4
  1. There is no documentation being shown on side for the Completion list.

See VS Code for example shows it.

Screencast.From.2024-11-12.01-24-23.mp4
  1. No auto completion of any kind.

refer this -> ABckh/zed-java-eclipse-jdtls#35 (same issue with this extension)

both of these (this and https://github.com/ABckh/zed-java-eclipse-jdtls) seem to use jdtls which is the same as what VS Code/ eclipse is using.

I see that this problem is not there in zed for C++ with clang, everything above is working as expected.

Observation from LSP logs:

  1. I see that eclipse.jdtls lsp didn't return additionalTextEdits, documentation, editText on completionItem/resolve request.
  2. From Zed source code I see
    image

These properties are marked for lazy evaluation and hence must be resolved lazily with completionItem/resolve request instead of textDocument/completion. Which didn't happen, (They are present in neither of those responses).

On changing commenting out the additionalTextEdits line (marking it not for lazy resolve), I managed to get additionalTextEdits in both completionItem/resolve and textDocument/completion, which made auto import work.

But I am not able to make any progress on documentation. (because documentation is by default lazy evaluated?!)

for textEditTexts they seem to be provided in textDocument/completion but not in completionItem/resolve.

I am not sure is this an issue with JDTLS or Zed. Knowing that many editors using JDTLS work fine, I suspect the issue has to be from Zed side.

my system details

OS: Fedora release 41 (Forty One) x86_64
Kernel: 6.11.6-300.fc41.x86_64
openjdk 23.0.1 2024-10-15
OpenJDK Runtime Environment (Red_Hat-23.0.1.0.11-1) (build 23.0.1+11)
OpenJDK 64-Bit Server VM (Red_Hat-23.0.1.0.11-1) (build 23.0.1+11, mixed mode, sharing)

I also have src, devel packages installed. and JAVA_HOME variable set.

Activity

  1. valentinegb commented on Nov 11, 2024

    @valentinegb
    Collaborator

    Thanks very much for looking into this! I am aware that JDTLS doesn't exactly use normal LSP, it uses its own extension of it, so I think you could blame JDTLS for weirdness. However, it's unlikely they would consider this a bug and change the behavior. The VSCode extension, for example, works because it implements LSP and the JDTLS extension of LSP completely from the ground up, specifically tailored to JDTLS. Zed, meanwhile, uses standard LSP, and is not implemented per extension. Zed may allow its extensions to implement LSP extensions in the future I think, but it doesn't right now, so probably the only way to fix these issues soon would be to handle JDTLS specifically in Zed itself (kinda like how Rust isn't an extension, it's handled by Zed itself). I'm not sure if the Zed maintainers would want to do that, but you could open an issue and pitch the idea if you'd like!

  2. changed the title [-]Not working -> auto imports, completion, documentation on linux[/-] [+]Support JDTLS LSP extensions[/+] on Nov 23, 2024
  3. valentinegb commented on Nov 24, 2024

    @valentinegb
    Collaborator

    I opened an issue related to this for Zed, you should watch it: zed-industries/zed#21133

  4. SaiKamalP commented on Nov 24, 2024

    @SaiKamalP
    Author

    I opened an issue related to this for Zed, you should watch it: zed-industries/zed#21133

    Hey, is this really the issue? the link you provided to the lsp extensions of jdtls has only two entries for "request from client to server". (
    The other two are just notification from server to client, not related to this ig.)

    I ran vs code java extenstion in verbose mode using "java.trace.server": "verbose" setting and I can say that none of these two lsp extensions were used.

    So I am wondering if this is really the problem.

  5. valentinegb commented on Nov 24, 2024

    @valentinegb
    Collaborator

    Maybe it's not, sorry, I just reread your issue
    I think I misremembered what the details of your issue actually was earlier ^^'
    In case you haven't yet, I think you should probably make an issue for Zed based on my understanding right now
    Also, since you have a better understanding of this issue than I do, feel free to rename this issue, sorry again ^^'

  6. changed the title [-]Support JDTLS LSP extensions[/-] [+] Not working -> auto imports, completion, documentation on linux[/+] on Nov 25, 2024
  7. SaiKamalP commented on Nov 25, 2024

    @SaiKamalP
    Author

    Hey, I think, I found the culprit, watch out at zed-industries/zed#21185

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    language-serverRelated to the language server.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions