scalameta / metals

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

fix: don't create `semanticdb` next to user sources for single files #6509

Closed kasiaMarek closed 2 weeks ago

kasiaMarek commented 2 weeks ago

resolves: https://github.com/scalameta/metals/issues/6508

This is the case where paths totally don't match and compiler panics and creates semanticdb next to the sources. Adding --semanticdb-sourceroot flag will cause it create it in the correct place for .scala files.

However, we don't actually use semanticdb for single files anyway, since the paths will still be broken for scripts. Maybe instead of --semanticdb-sourceroot, we could have a flag that stops semanticdb from being produced all together? CC: @tgodzik @Gedochao

kasiaMarek commented 2 weeks ago

Actually we can force the server to not create the semanticdb by not sending the version in initialize params for BSP.

It seems that even if we don't send it, it produces semanticdb.