Although IntelliJ Scala Plugin uses Scala compiler proper to generate the actual bytecode, it seems to use its own implementation of presentation compiler to provide real-time type-aware error highlighting in the editor:
syntax highlighting feature that is implemented by Idea's Scala plugin and it requires immediate re-processing of all the files you change in a way similar but now exactly the same as what the real compiler does.
This might be the reason why sometimes projects build successfully and yet IntelliJ shows false positive red underlines in the editor. This seems to be the case even if use sbt shell is selected as evident by open ticket SCL-11079
By default, the sbt compile should mark additional errors it finds in the editor and project view. False positive errors reported by the internal annotator should be removed if possible. There should be an option to use sbt output as the "single source of truth" for highlighting errors, at the cost of instant error highlighting.
or if project is imported as BSP project
sbt shell indeed won't help with error highlighting in the editor, nor will BSP (for the time being). In-ide highlighting uses a method that is completely separate from regular compilation
Is there anyway to configure IntelliJ to use Scala out-of-the-box presentation compiler instead of its own custom implementation such that we can decrease the chance false positive errors akin to what Metals provides?