nvim-metals
nvim-metals copied to clipboard
No "More information" for "Code navigation will not work"
Describe the bug
After importing my project I'm presented with:
Code navigation will not work for 182 build targets in this workspace due to mis-configuration. Select 'More information' to learn how to fix this problem..
Request Actions:
1. More information
2. Don't show again
And if I choose 1 – nothing happens.
Expected behavior
More information is provided.
Operating system
Linux
Version of Metals
0.11.6
Commit of nvim-metals
How to find out it in packer.nvim?
How to find out it in packer.nvim?
Run : PackerStatus, select nvim-metals, hit Enter. path shows you were the git repo is located on your machine.
Thanks for the report @arbitrary-dev. I just played around a bit locally to try and mimic this and it seems to be working for me. Can you ensure you're on the latest Metals (0.11.7), and also the latest nvim-metals and give it a try again? When it fails can you do a :MetalsToggleLogs and see if anything funky is in the logs?
When you select 1 here it should bring up the Metals Doctor in a floating window.
So the only way is to follow the path and then do git show, right? @kluen
Then I'm using the latest fa5245876d32182c9bd893a00857ffa58decb3c6 commit of nvim-metals.
Ok, now after the :MetalsUpdate to 0.11.7 the Metals Doctor window is actually shown to me after selecting 1. @ckipp01
Yet in this window I'm unable to see why "Code navigation will not work for 182 build targets...":
E486: Pattern not found: navig
I see only:
- recommendation: Goto definition for Java classes will not work, please install jdk sources in java home
Also :MetalsToggleLogs shows only cropped version of .metals/metals.log, which is kinda unexpected...
I see no issues related to "Code navigation" in .metals/metals.log as well though.
Yet in this window I'm unable to see why "Code navigation will not work for 182 build targets...":
It will be huge with 182 build targets, but basically you'd need to look through and see the ❌ marks in the various places, and then there is a key at the bottom which will explain them. The recommendation you posted actually is exactly the issue. Metals can't find the jdk sources it needs for navigation into Java sources, so navigation won't fully work. By chance are you running Arch? I see this often there. The solution is to install the *-src package that corresponds with the jdk you chose.
Also :MetalsToggleLogs shows only cropped version of .metals/metals.log, which is kinda unexpected... I see no issues related to "Code navigation" in .metals/metals.log as well though.
Well it scrolls, so you'd have to jump over to it and move down the logs.
To me "Code navigation will not work" is not the same as "Recommendation: Install Java sources if you want to navigate them".
When I see "Code navigation will not work" I have an impression that I won't be able to navigate the code in my own project.
When I see "Code navigation will not work" I have an impression that I won't be able to navigate the code in my own project.
But this is the case. You won't be able to jump to the definition of java.time.Instant for example. No navigation from scala -> java source will work.
That could be could in your project that you'd want to navigate to, so it's still best to warn the user of this.
Then I believe it would be better to mark these with ❌'s instead of Recommendation:
Then I believe it would be better to mark these with ❌'s instead of Recommendation:
These should be marked with ❌ in this scenario, are they not? Could you post the output of your doctor in a minimal reproduction?
Just wanted to check back in, are you still hitting on this, and if so can you put the full output of your doctor?
Going to go ahead and close. Feel free to report back if you're still hitting on this.