Skip to content
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

Doctor doesn't report missing src.zip file #3397

Closed
ayoub-benali opened this issue Dec 23, 2021 · 4 comments · Fixed by #3401
Closed

Doctor doesn't report missing src.zip file #3397

ayoub-benali opened this issue Dec 23, 2021 · 4 comments · Fixed by #3401

Comments

@ayoub-benali
Copy link
Contributor

ayoub-benali commented Dec 23, 2021

Describe the bug

When the src.zip file is missing from the java home directory, textDocument/definition would yield no results for java standard library classes like java.time.LocalDate.

Running metals doctor commands shows you that everything is fine.

To Reproduce

  1. Remove or rename src.zip
  2. Start Metals
  3. Try go to definition in java.time.LocalDate
  4. Notice that nothing happens

Expected behavior

Metals doctor should show a warning with a possible fix like sudo apt-get install openjdk-8-source or equivalent.

Installation:

  • Operating system: Linux
  • Editor: Sublime
  • Metals version: 0.10.9+213-69c1200a-SNAPSHOT

Search terms

java home, goto definiton, doctor

@tgodzik
Copy link
Contributor

tgodzik commented Dec 23, 2021

Thanks for reporting! We should refactor the doctor for sure and add more useful information like this.

@dos65
Copy link
Member

dos65 commented Dec 23, 2021

I'm wondering if it would be easy to download jdk-sources if they don't exist

@tgodzik
Copy link
Contributor

tgodzik commented Dec 23, 2021

We would need to download the whole JDK and unpack from that. The other option is to ship our own JDK as a default, which would always have src.zip, but that would be a bit heavy.

@ayoub-benali
Copy link
Contributor Author

Yeah I think downloading the sources would be overkill. For the moment just better error reporting would be a win.

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

Successfully merging a pull request may close this issue.

3 participants