Closed w-r-z-k closed 2 years ago
I have figured out why this happens; and it is not related to that message in the log. Simply put: The errors reported in nvim in the file you are editing are based on the results of an overall sbt build not on the errors currently in the file you are editing.
I have a full explanation in the closure report on nvim_metals issue #306
Describe the bug
Error reporting isn't showing up in nvim. There's a bug report in nvim-metals that has a detailed description. Since the problem occurs whether I am using the
nvim-metals
plugin or thelspconfig
configuration, I believe this to be a bug in metals.When I wipe out all
.bloop
and.bsp
and.metals
andtarget
folders and edit the source files anew, I am invited to import the build in nvim; and I do. Then I can edit the file. I see errors initially but it quickly stops working.My particular project has many scala source files, each with its own main entry point, via the
object Day1 extends App {}
idiom. I suspect that metals doesn't like this at all and stops working. But it's only a theory.To Reproduce
Steps to reproduce the behavior:
.bloop
,.metals
, andtarget
files.The metals log contains the error:
2021.12.27 14:18:45 INFO no build target found for /Users/user/Development/aoc2021/.metals/.tmp/Main6918781775207410564.scala. Using presentation compiler with project's scala-library version: 2.13.7
Expected behavior
I should see an error in the nvim editor.
Screenshots
Where's the red virtual text showing this error?
Installation:
Additional context
See nvim-metals issue #306
Search terms
metals, bloop, nvim, "no build target found"