You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enable flag "-Ysemanticdb" for compilation of dotty. It will cause build to fail.
Semanticdb is needed by metals to provide basic functionality for editors(find references/goto definition).
Here I created a branch showing where things fail what workarounds I did to make compilation succeed -> generate .semanticdb to let metals provide minimal support and how I enabled semanticdb generation(in case I messed up something :P). https://github.com/kpbochenek/dotty/pull/1/files
Problem 1:
There is a function file:ExtractSemanticDB.scala: private def adjustSpanToName(span: Span, qualSpan: Span, name: Name)(using Context) =
It throws exception that tries to access characters outside of current source file. It happens for a file: dotty/library/src/scala/quoted/autolift.scala 261 with 862 FOR [834..844..863] AND FunctionalInterface
(it means autolift.scala file with 261 characters but it tries to access Span in range 834-863 of name FunctionalInterface)
Problem 2:
When problem1 is fixed(or worked around) you hit problem 2.
so sometimes the source associated with a tree is not the same as the compilation unit, which can solve the span issue, The knock on effect of stopping the span crash is then a separate bug
whats more weird is that the issue with compiling dotty/library/src/scala/quoted/autolift.scala is that apparently it only crashes with a clean compile of dotty, and not just dotc on that file alone, perhaps some other flags are interfering
bishabosha
added a commit
to dotty-staging/dotty
that referenced
this issue
May 13, 2020
enable flag "-Ysemanticdb" for compilation of dotty. It will cause build to fail.
Semanticdb is needed by metals to provide basic functionality for editors(find references/goto definition).
Here I created a branch showing where things fail what workarounds I did to make compilation succeed -> generate .semanticdb to let metals provide minimal support and how I enabled semanticdb generation(in case I messed up something :P).
https://github.com/kpbochenek/dotty/pull/1/files
Problem 1:
There is a function
file:ExtractSemanticDB.scala: private def adjustSpanToName(span: Span, qualSpan: Span, name: Name)(using Context) =
It throws exception that tries to access characters outside of current source file. It happens for a file:
dotty/library/src/scala/quoted/autolift.scala 261 with 862 FOR [834..844..863] AND FunctionalInterface
(it means
autolift.scala
file with 261 characters but it tries to access Span in range 834-863 of name FunctionalInterface)Problem 2:
When problem1 is fixed(or worked around) you hit problem 2.
This one I have not checked more but workaround with
try catch
shows for now there is no more compilation error issues.The text was updated successfully, but these errors were encountered: