Build error/warning line numbers are one-too-low
Closed this issue ยท 9 comments
When I run bleep compile on a simple project all the error and warning line numbers are one-too-low.
For example:
blart
package submerged
Should be complaining about line 1, but references a line 0:
$ bleep compile Submerged
๐ Launching Bleep version 0.0.3 as requested in /Users/dwalend/projects/scala-ev3/firefly-coders-ev3dev/bleep.yaml
๐ bootstrapped in 35 ms
๐ BSP: Submerged expected class or object definition [value => file:///Users/dwalend/projects/scala-ev3/firefly-coders-ev3dev/Submerged/src/scala/submerged/Menu.scala:0:0 until 0:0]
๐ BSP: Submerged '{' expected. [value => file:///Users/dwalend/projects/scala-ev3/firefly-coders-ev3dev/Submerged/src/scala/submerged/Menu.scala:4:0 until 4:0]
๐ command failed: compile Submerged failed status code ERROR
โ-1 ~/projects/scala-ev3/firefly-coders-ev3dev [Submerged|โ 2โฆ11]
Is there some setting in the bleep.yaml I need to set? Or is this a bug from bloop or scalac ?
I have seen this as well. honestly I don't know, it seems to be correct in IDEs through BSP.
can you test newest 0.0.7 (once I manage to get it to sonatype) and newest scala and see if it's fixed?
can you test newest 0.0.7 (once I manage to get it to sonatype) and newest scala and see if it's fixed?
I'm glad to try it, but if you're seeing the same problem then I'm not sure what value I can add.
Does bleep post-process the errors from the compiler or just show each line raw? It could be the IDE support is adding one to the line number. I looked through some of the bleep code but didn't spot it. (It seems unlikely someone would subtract 1 from the line number before printing it out.)
so this info comes directly from bloop, you can find the thin bleep presentation layer in BspClientDisplayProgress
.
I briefly checked newest bleep and scala-cli with an illegal file, and scala-cli seems to get the position in the file right. I wonder if they patch the information from bloop or what's going on there
I briefly checked newest bleep and scala-cli with an illegal file, and scala-cli seems to get the position in the file right. I wonder if they patch the information from bloop or what's going on there
Do you know the right people working on bloop or scala-cli well enough to ask that indelicate question?
@tgodzik could know ๐
It's pretty easy to dig up in the scala-cli source actually. It seems like they do a lot of translation - I'll link it when I'm on a computer
Both LSP and BSP are 0-based, which is why it works in Metals. The editor just translates it to actual line numbers.
fixed in #422
Thanks!