How It Works
When enabled, FlowDeck:- Monitors file changes - Watches Swift and Objective-C source files for modifications
- Debounces changes - Waits for a configurable delay to batch multiple changes
- Runs incremental builds - Performs low-priority background builds with reduced CPU usage
- Updates code index - Automatically refreshes SourceKit LSP’s understanding of your code
- Parses build logs - Updates
.compilefiles for accurate LSP integration
Background builds run with reduced CPU priority and limited parallelism to minimize impact on your system performance.
Configuration
Access background build settings through: Settings → Extensions → FlowDeck → Language Server Protocol (Experimental)Available Settings
| Setting | Type | Default | Description |
|---|---|---|---|
flowdeck.lsp.backgroundBuilds.enabled | boolean | true | Enable/disable automatic background builds |
flowdeck.lsp.backgroundBuilds.delay | number | 3000 | Delay in milliseconds after file changes (1000-10000) |
flowdeck.lsp.backgroundBuilds.jobLimit | number | 4 | Number of parallel build jobs (1-16) |
flowdeck.lsp.backgroundBuilds.nicePriority | number | 15 | Process priority (0-19, higher = lower priority) |
flowdeck.lsp.backgroundBuilds.batteryAware | boolean | true | Reduce resources when on battery power |
flowdeck.lsp.backgroundBuilds.skipOnSyntaxErrors | boolean | true | Skip builds when files have syntax errors |
flowdeck.lsp.xcodebuildserver.autogenerate | boolean | true | Auto-regenerate build server config on scheme changes |
Performance Tuning
For Best Code Intelligence (Higher CPU Usage)
Balanced Performance (Default)
Low Resource Usage
Manual Builds Only
Battery-Aware Mode
WhenbatteryAware is enabled and your Mac is running on battery power:
- Build priority automatically increases to 19 (lowest)
- Job limit reduces to 2 parallel jobs
- Helps conserve battery life during development
Understanding Build Priority
ThenicePriority setting controls how much CPU the background builds can use:
- 0-9: Higher priority than normal processes (not recommended)
- 10-14: Moderate priority
- 15-19: Low priority (recommended for background builds)
- 19: Lowest priority, yields to all other processes
Monitored File Types
Background builds trigger for changes to:*.swift- Swift source files*.h- Header files*.m- Objective-C source files*.mm- Objective-C++ source files*.cpp,*.cc,*.c- C/C++ source files*.hpp,*.hxx- C++ header files
/.build/- Swift Package Manager build directory/DerivedData/- Xcode derived data/build/- Generic build directories
Related Commands
| Command | Description |
|---|---|
FlowDeck: Toggle Background LSP Builds | Enable/disable background builds |
FlowDeck: Show Background LSP Build Status | Display current build status |
FlowDeck: Update LSP Index for Current File | Manually trigger indexing for current file |
FlowDeck: Quick Build for LSP Update | Perform a quick build to update code intelligence |
Xcode Build Server Integration
FlowDeck automatically manages thebuildServer.json configuration file that connects SourceKit LSP to the Xcode build system. When you change schemes or build configurations, FlowDeck:
- Detects the change
- Regenerates
buildServer.json - Updates build flags in
.compilefiles - SourceKit LSP automatically picks up the changes
Troubleshooting
Background Builds Not Starting
- Check that
flowdeck.lsp.backgroundBuilds.enabledistrue - Verify you have an active scheme selected
- Ensure your project builds successfully manually first
High CPU Usage
- Increase the
delaysetting to batch more changes - Reduce
jobLimitto use fewer parallel jobs - Increase
nicePriorityto 18 or 19
Code Intelligence Not Updating
- Check the Output panel for build errors
- Ensure syntax errors are fixed (or disable
skipOnSyntaxErrors) - Try a manual build with
FlowDeck: Build
Battery Draining Quickly
- Enable
batteryAwaremode - Increase
nicePriorityto 19 - Consider disabling background builds on battery
Best Practices
- Start with defaults - The default settings work well for most projects
- Adjust based on project size - Larger projects benefit from longer delays
- Monitor CPU usage - Use Activity Monitor to ensure builds aren’t impacting performance
- Fix syntax errors quickly - Background builds skip files with syntax errors by default
- Use manual builds for major changes - After big refactors, run a full manual build
Background builds require a successful initial build. Always ensure your project builds successfully before relying on automatic background builds.
