Ammonite
Ammonite copied to clipboard
Wrong SemanticDB position for first line of script…
…if it contains a comment or an empty line first.
For example, in the coursier sources, using metals 0.9.0+139-c169b4ce-SNAPSHOT (which pulls Ammonite 2.1.4), doing a go-to-source on Versions.latestFromTag in launcher.sc brings me to this position:

This is confirmed when manually inspecting the post-processed SemanticDB:
$ metap .ammonite/scala-2.12.11/amm-2.1.4/scripts/shared/Version/target/META-INF/semanticdb/scripts/shared/Version.sc.semanticdb |grep 'Version\.latestFromTag'
ammonite/$file/scripts/shared/Version.latestFromTag(). => method latestFromTag: String
[1:16..1:29): g: String = { <= ammonite/$file/scripts/shared/Version.latestFromTag().
(should be [1:4..1:17) rather than [1:16..1:29)).
FYI @tgodzik, I found conditions under which position errors still happen on the first line… Maybe this is what you saw in https://github.com/scalameta/metals/pull/1538#issuecomment-627462563?
I'll try to find time to fix this here.
Och, that might it! It started to work for me, so I assumed it was fixed.
so I assumed it was fixed.
It was -partly- fixed.