scalameta / metals

Scala language server with rich IDE features 🚀
https://scalameta.org/metals/
Apache License 2.0
2.09k stars 331 forks source link

Semantic tokens misaligned on a build.sbt file #5553

Closed keynmol closed 1 year ago

keynmol commented 1 year ago

Describe the bug

I've not managed to trivially reproduce it, but the source where it happens is here: https://github.com/indoorvivants/sn-bindgen-web/blob/main/build.sbt#L223

CleanShot 2023-08-15 at 14 19 14@2x

Expected behavior

Tokens are positioned correctly

Operating system

None

Editor/Extension

Nvim (nvim-metals)

Version of Metals

1.0.0+59-0074f74d-SNAPSHOT

Extra context or search terms

semantic tokens, build.sbt, misalignment, positions

jkciesluk commented 1 year ago

Thanks for reporting! it looks like there is an issue with s-strings with triple quote, but only if the closing quote is at the start of the line

s"""
this breaks
"""
val x = 1
s"""
this doesn't
 """
val x = 1