liveBook · Manning

Compiler semantic model

As explained in Vibe Engineering

A compiler semantic model is the compiler's resolved representation of program symbols, types, references, and language meaning.

A compiler semantic model is the compiler-resolved view of symbols, types, references, dependencies, and language meaning. Through Language Server Protocol (LSP), this view becomes available to editors and AI agents rather than requiring raw-file scanning. section 3.3.4

Its practical value comes from build-time facts that ordinary text inspection can miss:

  • Resolved types, such as the inferred type of avatarUrl: Option[String]. section 3.3.4
  • Symbol definitions, autocomplete, type hover, refactorings, semantic tokens, and code actions. section 3.3.4
  • Actual dependency versions, transitive libraries, classpaths, and source JAR information. section 3.3.4

Scala through Metals

A Scala project connected through Metals gives an agent compiler-level access to symbols, types, build configuration, and the full classpath. This is authoritative for type correctness and dependency resolution, but not for production runtime behavior. section 3.3.4

Figure 3.4 MCP ↔ LSP (Metals) with Claude Desktop as MCP Client.

Use the architecture diagram to trace Claude Desktop as the MCP client, Metals as the LSP server, and compiler-level project access between them. section 3.3.4

How Vibe Engineering covers it

How deep it goes
Reaches resolved types, symbols, classpaths, and dependency versions, but stops short of runtime and deployment behavior.
Examples
Uses Scala, Metals, Claude Desktop, UserProfileCardProps, inferred Option[String] types, classpaths, and source JARs.
What it assumes
Assumes an available language server and project build context, while distinguishing compiler facts from deployment configuration.
What you can do after
Apply it via LSP to inspect project truth, navigate symbols, verify types, resolve dependencies, and support safer code changes.
How it connects
Connects Language Server Protocol, Model Context Protocol, type correctness, dependency resolution, build systems, and runtime configuration.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Vibe Engineering. The section links point to the parts of the book it draws on.