Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Navigation to *.class file (jdt:// scheme) is missing #42

Open
fbricon opened this issue Nov 3, 2017 · 7 comments
Open

Navigation to *.class file (jdt:// scheme) is missing #42

fbricon opened this issue Nov 3, 2017 · 7 comments

Comments

@fbricon
Copy link
Contributor

fbricon commented Nov 3, 2017

jdt.ls sends jdt:// uris for navigating to source code of classes in jar files. In vscode-java a provider is registered for the jdt scheme:

https://github.com/redhat-developer/vscode-java/blob/977973499608ccd5e64115876b250c5dae062023/src/extension.ts#L213-L221

https://github.com/redhat-developer/vscode-java/blob/56c5256f04b2d64208ff5346399cf2e1f94405aa/src/protocol.ts#L69-L71

@fbricon fbricon changed the title Navigation to *.class file Navigation to *.class file (jdt:// scheme) is missing Nov 3, 2017
@fbricon
Copy link
Contributor Author

fbricon commented Nov 3, 2017

why isn't the code embedded in this issue?

@damieng
Copy link
Contributor

damieng commented Nov 3, 2017

Implementation notes:

  • We'll need to add the JDT protocol via atom.workspace.addOpener
  • When we see a request for that we obtain the contents via java/classFileContents
  • Create a TextEditor and inject the contents in so we get syntax highlighting
  • I wish we had a read-only text editor ...

@damieng
Copy link
Contributor

damieng commented Nov 3, 2017

@fbricon looks like we might just be able to wire the protocol handler up to the language server itself for obtaining the file contents?

Not sure what "code embedded in this issue" refers to.

@fbricon
Copy link
Contributor Author

fbricon commented Nov 3, 2017

Yes calling java/classFileContents with that jdt uri will return the source, you don't need to worry about opening/traversing the jar.

For the embedded code, I'm talking about https://github.com/blog/2415-introducing-embedded-code-snippets. It seems to only work for code from the same repo.

@damieng
Copy link
Contributor

damieng commented Nov 29, 2017

Read only text editor coming in atom/atom#16294 which will unblock this

@fbricon
Copy link
Contributor Author

fbricon commented May 4, 2018

FYI, I plan on disabling sending those jdt:// uris unless clients advertise they support it (see eclipse-jdtls/eclipse.jdt.ls#649). @damieng you might want to keep an eye on that one.

@fbricon
Copy link
Contributor Author

fbricon commented May 17, 2018

With jdt.ls 0.19.0 (or more recent), clients need to declare their support for jdt:// urls by sending extendedClientCapabilities.classFileContentsSupport=true in initializationOptions. See eclipse-jdtls/eclipse.jdt.ls#649 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants