06 · AI in the IDE: VS Code, IntelliJ IDEA, Xcode
Your IDE is where AI pays off most. This page explains the four ways AI works inside an editor, then walks through three major IDEs: IntelliJ IDEA and VS Code (the main homes for Scala) and Xcode (Apple's IDE), and compares them.
By the end of this page you can
- Use the four interaction modes (completion, chat, inline edit, agent) and pick the right one for a task.
- Find and configure AI features in VS Code, IntelliJ IDEA and Xcode.
- Follow a reliable explore → plan → implement → verify → review workflow.
- Set agent permissions sensibly.
The four interaction modes
| Task | Best mode |
|---|---|
| Writing code you already have in your head | Completion |
| "What does this do?", "Why is this failing?", "Which approach is better?" | Chat / Ask |
| "Convert this loop to a fold", "Add error handling here" | Inline edit |
| "Add a new endpoint with service, repository, tests; make the build pass" | Agent |
| "Plan how to migrate this module to Scala 3" | Plan mode / Ask, then Agent |
IntelliJ IDEA (JetBrains)
IntelliJ IDEA with the Scala plugin is the most widely used IDE for professional Scala development. It is also common for Java and Kotlin.
AI features
- JetBrains AI Assistant: code completion (including local, on-device completion for some languages), chat aware of your project, inline edits, commit-message generation, test generation, explanations, and a choice of models (cloud and local).
- Junie: JetBrains' coding agent. It plans, edits multiple files, runs tests and uses IDE inspections. You review the result.
- Bring your own agent: JetBrains IDEs support external agents through the Agent Client Protocol (ACP) and can act as an MCP client, so other agents and tools can plug in.
- Third-party plugins: GitHub Copilot and others are available for JetBrains IDEs.
Scala-specific tips in IntelliJ
- Make sure the sbt/Mill/Gradle project is fully imported and indexed before asking AI questions. The AI uses the IDE's understanding of your code.
- IntelliJ's own inspections and type hints are an excellent check on AI output. Watch for red and yellow highlights after accepting a suggestion.
- Tell the assistant whether you use Scala 2.13 or Scala 3. The syntax differs (indentation-based syntax,
given/using,enums).
VS Code
VS Code is a lightweight, extensible editor with the largest AI ecosystem. For Scala, install the Metals extension (the Scala language server). For Python, install the Python and Pylance extensions.
AI features (GitHub Copilot in VS Code)
- Inline suggestions and next edit suggestions (it predicts the next place you will edit and what).
- Chat view with built-in agent roles such as Ask, Plan and Agent. You can pick the model and the agent harness (Copilot's own, or third-party agents).
- Inline chat (Ctrl/Cmd+I) for in-place edits.
- Context:
#-references and drag-and-drop for files, symbols, terminal output, changes and more. - Customisation:
.github/copilot-instructions.md,AGENTS.md,*.instructions.md, custom agents (*.agent.md), Agent Skills (SKILL.md), hooks, plugins, all managed in an Agent Customizations editor. See page 07. - MCP servers: add servers per workspace or per user to give agents extra tools (page 09).
- Other extensions (Continue, Cline, Gemini Code Assist and more) can be installed alongside or instead.
Scala in VS Code
- Metals provides compile errors, go-to-definition, completions and worksheets. AI suggestions that don't compile show up immediately.
- Recent Metals versions include an MCP server that exposes compilation, symbol inspection, test running and more to AI agents. An agent can then ask the compiler instead of guessing. See page 10.
Xcode (Apple)
Xcode is Apple's IDE for Swift and Objective-C apps on iOS, macOS, watchOS, tvOS and visionOS. It does not target Scala, but it is useful context if you work near Apple platforms, and it shows where the industry is heading.
Coding intelligence in Xcode 26
- Predictive code completion powered by an on-device model trained for Swift and Apple SDKs, so code stays on your Mac.
- Coding assistant chat: set up in Xcode → Settings → Intelligence. Built-in integrations include ChatGPT and Claude, and you can add other providers, including local models.
- Agentic coding (Xcode 26.3+): coding agents can work inside Xcode. They break down tasks, edit files, build, read build errors, run tests and search Apple documentation.
- MCP: Xcode exposes its capabilities (build, test, docs search) as an MCP server, so external agents can use them. You enable "Allow external agents to use Xcode tools" in Intelligence settings and connect the agent via
xcrun mcpbridge. - ACP: agents that support the Agent Client Protocol can be added to Xcode as additional agents.
- A fine-grained permissions system controls what external agents may do.
# After enabling "Allow external agents to use Xcode tools" in Xcode > Settings > Intelligence claude mcp add --transport stdio xcode -- xcrun mcpbridge # or codex mcp add xcode -- xcrun mcpbridge
Side-by-side comparison
| IntelliJ IDEA | VS Code | Xcode | |
|---|---|---|---|
| Best for | Scala, Java, Kotlin (JVM) | Polyglot: Scala (Metals), Python, TS, everything | Swift / Apple platforms |
| Language intelligence | Own deep Scala plugin | Language servers (Metals, Pylance) | Swift compiler, SourceKit |
| Built-in AI | AI Assistant + Junie agent | Copilot (built-in chat), many extensions | On-device completion + coding assistant + agents |
| Model choice | Multiple cloud + local | Multiple, plus bring-your-own | ChatGPT, Claude, other providers, local |
| Agent mode | Yes (Junie, ACP agents) | Yes (Copilot agent, third-party harnesses) | Yes (26.3+) |
| MCP | Client (use servers), and exposes IDE tools | Client (rich config) | Exposes Xcode as a server for external agents |
| Customisation files | Project guidelines/rules, AGENTS.md | copilot-instructions.md, AGENTS.md, .instructions.md, .agent.md, SKILL.md | AGENTS.md / agent config files |
| Cost | IDE (Community/Ultimate) + AI subscription | Free editor + AI subscription (free tiers exist) | Free; model providers may need accounts |
Many developers also run a terminal agent (page 05) next to any of these IDEs. It works the same in every editor and can be pointed at the IDE's MCP server.
A reliable daily workflow
- Explore. Ask mode: "How does authentication work in this repo? Which files are involved?" Build your own understanding first.
- Plan. For anything over ~30 lines, ask for a plan: files to touch, steps, risks, tests. Edit the plan. It is cheap to fix a plan and expensive to fix code.
- Implement in small steps. Let the agent do one step at a time, or the whole plan if it is well specified.
- Verify automatically. The agent compiles and runs tests. Ask it to add tests for the change.
- Review like a human PR. Read the full diff. Ask "explain this change" for anything unclear. Check edge cases, naming and security.
- Commit in small units. Use git as your undo button: commit before big agent runs and after each good step.
Agent permissions
Agents can run terminal commands, edit files and call tools. Every serious IDE has approval settings:
| Setting | Recommendation for beginners |
|---|---|
| File edits | Allow inside the workspace, and review the diffs. |
| Terminal commands | Require approval, or auto-approve only a safe allow-list (sbt test, pytest, git status). |
| Destructive commands | Always require approval: rm -rf, git push --force, database migrations, deployments. |
| MCP tools | Only enable servers you trust. Approve tool calls that write or send data. |
| Network / web | Be careful: fetched web content can contain prompt injections (page 14). |
Productivity habits
- Learn your IDE's AI keyboard shortcuts: accept suggestion, accept next word, open inline chat, open chat, attach context.
- When a completion is almost right, accept it and fix it. Don't keep retrying.
- Write a good comment or function signature first. Completions follow intent.
- Keep an
AGENTS.mdwith build/test commands so agents can verify their own work. - Use the agent for chores (dependency bumps, test scaffolding, renames across files) and keep the hard thinking for yourself, with the AI as a sparring partner.
Key takeaways
- Four modes: completion, chat, inline edit, agent. Match the mode to the task.
- IntelliJ IDEA and VS Code + Metals are the Scala homes. Xcode is Apple's IDE with on-device completion and agents.
- All three are converging on MCP and ACP, so agents can use real IDE tools.
- Workflow: explore → plan → implement → verify → review → commit.
- Set permissions deliberately. Review everything.