-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unsupported Scala 2.11 (2.11.12) #5561
Comments
Thanks for reporting! Looks like shading is not working for Scala 2.11.12 and since we no longer test for it, this never got detected. |
You can switch the Metals version to a previous one for the time being. |
@tgodzik this does NOT work for BSP neither - not only for BLOOP.
VSC version: 1.81.1 WORKAROUNDfallback to Metals v0.11.12 Aluminium |
Scalafix stopped supporting 2.11, not sure if I can do anything about that though 🤔 but we should at a minimum fix the issue at hand. |
Btw. is there anything that can be done to help migrate your codebases to at least Scala 2.12.x ? |
@tgodzik I would love to migrate even to 2.13.x. Unfortunately my project is not running stand-alone but it is big corpo running Spark 2.3.0 using Scala 2.11.x (Java 1.8.121) on Hadoop Cluster CDP 5.16. I can try to upgrade to Scala 2.12.x but I have some shared libraries that are used by other teams and projects and not necessary they will like the idea as they prefer to compile their codebase with the same Scala line which is used for Spark. |
I got same problem. My sbt file has few sub-projects and most of those cross compiled to (2.11.12, 2.12.3, 2.13.4) but one project stuck on 2.11.12 (big legacy Play app) so as result 2.11.12 still configured as main version in build.sbt. Because of this issue seems auto completion doesn't work across all projects even if most can be compiled to 2.13). |
There is a PR (scalameta/scalameta#3346) that should help, but we haven't yet released a new scalameta version. Probably scalafix will not work, so the only solution for now would be using older scalafix version. I should probably also just freeze the next Scala 2.11 version 🤔 |
Newest Metals version should support Scala 2.11.12 again. Only running scalafix rules and organize imports will fail. |
Although I noticed it will only work on JDK 8 due to some old issue in the Scala compiler |
I managed to get Scalafix working again in https://github.com/scalameta/metals/pull/5770/files though no bufixes for that rule will be available. I will try to add back testing for 2.11.12 and close the issue. |
@tgodzik it should be fine for Scala 2.11.12 and JDK 8. Spark 2.3 will be running on JDK 8. Update on CDP (or HDP) will firstly update Scala version to at least 2.12 before updating Java version. That should be sufficient. Thanks a lot. |
Added the test back in #5825 We will probably support Scala 2.11.12 indefinitely, but we will switch off active support at some point. |
Tested it with |
If you create a project (maven or sbt) with versión 2.11.12, de auto complementation not working, de bloop.log show the error:
Exception in thread "pool-36-thread-1" java.lang.NoClassDefFoundError: scala/meta/shaded/internal/fastparse/ParserInputSource
at scala.meta.internal.tokenizers.ScalametaTokenizer.scala$meta$internal$tokenizers$ScalametaTokenizer$$uncachedTokenize(ScalametaTokenizer.scala:22)
at scala.meta.internal.tokenizers.ScalametaTokenizer$$anonfun$tokenize$1.apply(ScalametaTokenizer.scala:17)
at scala.meta.internal.tokenizers.ScalametaTokenizer$$anonfun$tokenize$1.apply(ScalametaTokenizer.scala:17)
at scala.collection.concurrent.TrieMap.getOrElseUpdate(TrieMap.scala:901)
at scala.meta.internal.tokenizers.ScalametaTokenizer.tokenize(ScalametaTokenizer.scala:17)
at scala.meta.internal.tokenizers.ScalametaTokenizer$$anon$2.apply(ScalametaTokenizer.scala:332)
at scala.meta.tokenizers.Api$XtensionTokenizeDialectInput.tokenize(Api.scala:25)
at scala.meta.tokenizers.Api$XtensionTokenizeInputLike.tokenize(Api.scala:14)
at scala.meta.internal.parsers.ScannerTokens$.apply(ScannerTokens.scala:873)
at scala.meta.internal.parsers.ScalametaParser.(ScalametaParser.scala:33)
at scala.meta.parsers.Parse$$anon$1.apply(Parse.scala:35)
at scala.meta.parsers.Api$XtensionParseDialectInput.parse(Api.scala:25)
at scala.meta.internal.semanticdb.scalac.ParseOps$XtensionCompilationUnitSource.toSource(ParseOps.scala:17)
at scala.meta.internal.semanticdb.scalac.TextDocumentOps$XtensionCompilationUnitDocument.toTextDocument(TextDocumentOps.scala:206)
at scala.meta.internal.pc.SemanticdbTextDocumentProvider.textDocument(SemanticdbTextDocumentProvider.scala:54)
at scala.meta.internal.pc.ScalaPresentationCompiler$$anonfun$semanticdbTextDocument$1.apply(ScalaPresentationCompiler.scala:350)
at scala.meta.internal.pc.ScalaPresentationCompiler$$anonfun$semanticdbTextDocument$1.apply(ScalaPresentationCompiler.scala:345)
at scala.meta.internal.pc.CompilerAccess.withSharedCompiler(CompilerAccess.scala:146)
at scala.meta.internal.pc.CompilerAccess$$anonfun$1.apply(CompilerAccess.scala:92)
at scala.meta.internal.pc.CompilerAccess$$anonfun$onCompilerJobQueue$1.apply$mcV$sp(CompilerAccess.scala:231)
at scala.meta.internal.pc.CompilerJobQueue$Job.run(CompilerJobQueue.scala:152)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
Caused by: java.lang.ClassNotFoundException: scala.meta.shaded.internal.fastparse.ParserInputSource
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 24 more
The text was updated successfully, but these errors were encountered: