Scala
Completed
-
Section 1: Getting Started
-
Section 2: Core Syntax
-
Section 3: Object-Oriented Scala
-
Section 4: Functional Scala
-
Section 5: Collections in Depth
-
Section 6: Type System
-
Section 7: Concurrency and Ecosystem
-
Section 8: Practical Projects
-
Section 9: Interview Practice
-
Section 10: Data Structures and Algorithms in Scala
-
Section 11: More Practice Exercises
-
Section 12: Advanced Functional Patterns
-
Section 13: More Ecosystem
-
Section 14: Scala Collections Library Deep Dive
-
Section 15: Scala Standard Library Deep Dive
-
Section 16: Akka Ecosystem Deep Dive
-
Section 17: Cats and Cats Effect Deep Dive
-
Section 18: Play Framework Deep Dive
-
Section 19: Apache Spark with Scala Deep Dive
-
Section 20: Scala Build Tools Deep Dive
-
Section 21: Scala 3 Specific Features
-
90: Union and Intersection Types
-
Section 22: Scala Testing Deep Dive
-
Section 23: Functional Domain Modeling
-
Section 24: More Data Structures and Algorithms in Scala
-
Section 25: Scala for Data Engineering
-
Section 26: More Practical Projects
-
Section 27: More Interview and Review
-
Section 28: ZIO Ecosystem Deep Dive
-
Section 29: Scala for Machine Learning
-
Section 30: Scala Microservices Architecture
-
Section 31: Scala Type System Deep Dive
-
Section 32: More Practice and Drills
-
Section 33: Scala Performance Deep Dive
-
Section 34: Scala Ecosystem Tooling
-
Section 35: Scala for Reactive Systems
-
Section 36: More Real-World Case Studies
-
Section 37: Scala for Financial Systems
-
Section 38: Scala GraphQL and gRPC
-
Section 39: More Final Projects
-
Section 40: More Interview and Final Review
-
Section 41: Scala for Streaming Data
-
Section 42: Scala Security Practices
-
Section 43: More Language Deep Dive
-
Section 44: Scala Command-Line Tools
-
Section 45: Scala Documentation and Style
-
Section 46: Scala Dependency Management
-
Section 47: More Practical Backend Patterns
-
Section 48: Scala for Event-Driven Architecture
-
Section 49: More Practice Drills Round 2
-
Section 50: Scala Compiler Deep Dive
-
Section 51: Scala for Web Frontends
-
Section 52: More Data Engineering Practice
-
Section 53: Scala Observability
-
Section 54: More Advanced Practice Projects
-
Section 55: Scala for Legacy Java Integration
-
Section 56: More Testing Practice
-
Section 57: Final Mastery Review
-
Section 58: Scala History and Ecosystem Context
-
Section 59: More Concurrency Patterns
-
Section 60: Scala for Configuration Management
-
Section 61: More Domain Modeling Practice
146: Bloop for Fast Compilation
You've probably been there: you run sbt compile in your terminal, it finishes successfully, and you're ready to ship. But when you look back at your IDE, the screen is a sea of red. Your imports are screaming that classes don't exist, and the "Import Build" button in Metals seems to be spinning in a void. It's maddening because the code is correct, but the IDE doesn't believe you.
// In your IDE, this looks like an error:
import com.company.internal.NewFeatureClient
def process(): Unit = {
// Error: Not found: type NewFeatureClient
val client = new NewFeatureClient()
client.execute()
}
The Disconnect Between sbt and your Editor
The problem isn't your code, and it isn't even really Metals. The issue is that sbt is a heavy-duty build tool designed for the CLI, but IDEs need a way to ask "what is the classpath for this specific file?" thousands of times a minute as you type. In the old days, the IDE tried to mimic the build tool, which led to those legendary "refreshing project" hangs that lasted ten minutes.
This is where Bloop comes in. Bloop is a build server. Instead of the IDE trying to be a build tool, sbt (or Mill) generates a configuration file that tells Bloop: "Here is exactly where every jar and source file lives." Bloop then stays resident in memory, providing a lightning-fast API that Metals queries to resolve symbols.
The "ghost errors" you're seeing happen when the Bloop configuration is stale. You added a dependency to build.sbt, the terminal knows about it, but the Bloop server is still holding onto the old classpath. You're essentially talking to a version of your project that exists in the past.
Synchronizing the Build Server
To fix this, you don't just "restart the IDE"—that's the nuclear option and it rarely solves the underlying config mismatch. You need to force the build tool to re-emit the Bloop configuration.
- If you're using Metals, you'll see a notification to "Import Build." When you click this, Metals calls sbt, which then updates the
.bloop/directory in your project root. - If that's hanging, the most reliable fix is to clean the Bloop state entirely. I usually do this by deleting the
.bloop/folder and the.metals/folder and then triggering a fresh import.
Once the .bloop/ directory is updated, Bloop loads the new classpath into memory. Suddenly, the red squigglies disappear because Metals can now ask Bloop, "Where is NewFeatureClient?" and Bloop can answer instantly with the exact path to the jar, without having to boot up a full sbt session.
I've found that as your project grows into a multi-module build, this becomes critical. Bloop allows for incremental compilation that is far more granular than what you get from a standard sbt run, because it tracks the dependency graph at a much tighter level. It essentially turns your compilation process from a "batch" job into a "service."
📋 Practical Task
Resolving a Stale Classpath in a Multi-Module Project
You are working on a project with two modules: core and api. The api module depends on core. You have just added a new case class UserSession to the core module.
The Situation:
1. You run sbt compile and it succeeds.
2. In the api module, you try to use UserSession, but the IDE marks it as an unresolved symbol.
3. You have already tried clicking "Import Build" once, but the error persists.
Your Goal:
Perform a deep reset of the build server to force a clean synchronization between sbt and Bloop. Describe the specific steps you would take regarding the project's hidden directories and the Metals action required to ensure the api module can finally "see" the UserSession class from the core module.
There are no comments for now.