Support/workaround for no-default Predef settings?

For a while (Lightbend) Scala supported Predef disabling flags -Yno-predef and -Yno-imports - they help get get rid of some of scala.Predef quirks by not importing it in the first place and allowing for import my.Predef._ instead. Currently this approach is not really supported, but workable. Built-in types are highlighted as normal classes, and if one forget to import it compilation will fail, while syntax highlighting shows no issue.

However there is an ongoing PR that was already merged in Typelevel Scala that adds support for -Ysysdef and -Ypredef where one can configure own import lines that should land for every compiler file (and so one doesn't have to add import my.Predef._ everywhere). However, this one is much more annoying as it results with cannot resolve symbol  for things that were not present in original scala.Predef.

I cannot expect that Intellij would add support for feature that is not (yet?) very popular, but are there some existing settings, that could help me get rid of those errors? Alternatively, if this could be resolved by e.g. writing addon or plugin where can I find some samples for Intellij Scala extension?

Comment actions Permalink
Official comment
Comment actions Permalink

We have a ticket for this for quite a while, but it is not implemented yet.

I don't know any workaround for this problem except for completely disabling error highlighting:

You may try to make a pull request to the plugin itself:

I would start with a text search of "scala.Predef" in our sources. Also to get scalac options, you'll probably need `org.jetbrains.plugins.scala.project.ProjectPsiElementExt.module` and `org.jetbrains.plugins.scala.project.ModuleExt.scalaCompilerSettings` extension methods. 

Feel free to ask more questions if you decide to do it.

Comment actions Permalink

Please fix this as it will increasingly become an issue in 2.13.x with the introduction of


Please sign in to leave a comment.