Skip to content

AudioLab VS Code Settings

Comprehensive VS Code configuration for AudioLab audio plugin development.

📁 Files Overview

File Purpose Scope
settings.json Workspace settings for AudioLab project Project-specific
settings.global.json User preferences and personal settings User-wide
install-settings.ps1 Automated installation script Deployment
README.md Documentation Reference

🚀 Quick Start

# Install all settings (workspace + user)
.\install-settings.ps1

# Install only workspace settings
.\install-settings.ps1 -Mode workspace

# Preview changes without applying
.\install-settings.ps1 -DryRun

# Force installation without prompts
.\install-settings.ps1 -Force

Manual Installation

Workspace Settings

  1. Copy settings.json to C:\AudioDev\audio-lab\.vscode\settings.json
  2. Restart VS Code

User Settings

  1. Open VS Code user settings: Ctrl+, → Click {} (Open Settings JSON)
  2. Merge contents from settings.global.json into your user settings
  3. Save and restart VS Code

📋 What's Included

Workspace Settings (settings.json)

Configured for AudioLab development:

C++ Development

  • Standard: C++20 / C17
  • Compiler: MinGW-w64 GCC (MSYS2)
  • IntelliSense: Full project indexing
  • Include Paths:
  • FOUNDATION layer
  • COMPONENTS layer
  • PRODUCTS layer
  • vcpkg packages
  • Defines: Windows-specific audio development macros

CMake Integration

  • Generator: Ninja (fast builds)
  • Toolchain: vcpkg integration
  • Build Directory: ${workspaceFolder}/build
  • Configure on Open: Disabled (manual control)
  • Export Compile Commands: Enabled (for Clangd)

File Associations

Audio and DSP file formats recognized: - .dsp, .faust → C++ - .pd, .maxpat, .vstpreset → JSON - Binary audio files (.wav, .aiff, .flac) → Binary viewer

Code Formatting

  • Tabs: 4 spaces (enforced)
  • Format on Save: Enabled
  • Rulers: 80, 100, 120 columns
  • Formatter: Clangd (LLVM style)
  • Line Endings: LF (Unix-style)

Git Integration

  • Auto-fetch enabled
  • Smart commit
  • Trim whitespace on save
  • Insert final newline

Terminal Configuration

Multiple profiles available: - PowerShell (default) - Command Prompt - MSYS2/MinGW64 (for Unix-like tools)

Performance Optimizations

  • Build directory excluded from file watcher
  • Search excludes build artifacts
  • Large file support (4GB+)
  • Incremental search cache

User Settings (settings.global.json)

Personal preferences and global configuration:

Theme & Appearance

  • Theme: Default Dark Modern (customizable)
  • Font: Cascadia Code / Fira Code / JetBrains Mono
  • Font Size: 13px (editor), 12px (terminal)
  • Ligatures: Enabled
  • Smooth Scrolling: Enabled

Editor Behavior

  • Cursor: Smooth blinking line cursor
  • Auto Save: On focus change
  • Tab Completion: Enabled
  • Parameter Hints: Enabled
  • Semantic Highlighting: Enabled

Audio Development

  • Default Sample Rate: 48kHz
  • Default Buffer Size: 512 samples
  • Bit Depth: 24-bit
  • Plugin Paths: VST3, AAX, CLAP, AU

Environment Variables

AUDIOLAB_ROOT=C:\AudioDev\audio-lab
VCPKG_ROOT=C:\vcpkg
AUDIOLAB_BUILD_DIR=C:\AudioDev\audio-lab\build

🔧 Customization Guide

Changing Compiler

Edit settings.json:

{
  "C_Cpp.default.compilerPath": "C:/path/to/your/compiler.exe",
  "C_Cpp.default.intelliSenseMode": "windows-gcc-x64"  // or windows-clang-x64
}

Adding Include Paths

{
  "C_Cpp.default.includePath": [
    "${workspaceFolder}/**",
    "C:/your/custom/include/path"
  ]
}

Changing Theme

Edit settings.global.json:

{
  "workbench.colorTheme": "One Dark Pro",
  "workbench.iconTheme": "material-icon-theme"
}

Adjusting Font

{
  "editor.fontFamily": "'JetBrains Mono', 'Fira Code', monospace",
  "editor.fontSize": 14,
  "editor.fontLigatures": true
}

CMake Generator

{
  "cmake.generator": "Ninja",           // Fast
  "cmake.generator": "Visual Studio 17 2022",  // MSVC
  "cmake.generator": "Unix Makefiles"   // Make
}

📦 Required Extensions

Essential

  • C/C++ (ms-vscode.cpptools)
  • CMake Tools (ms-vscode.cmake-tools)
  • Clangd (llvm-vs-code-extensions.vscode-clangd)
  • vcpkg CMake Tools (JackBoosY.vcpkg-cmake-tools)
  • GitLens (eamodio.gitlens)
  • Better Comments (aaron-bond.better-comments)
  • Doxygen Documentation Generator (cschlosser.doxdocgen)
  • Error Lens (usernamehw.errorlens)
  • Markdown All in One (yzhang.markdown-all-in-one)

Install all recommended extensions:

# Using VS Code CLI
code --install-extension ms-vscode.cpptools
code --install-extension ms-vscode.cmake-tools
code --install-extension llvm-vs-code-extensions.vscode-clangd
code --install-extension JackBoosY.vcpkg-cmake-tools

🛠️ Installation Script Reference

install-settings.ps1

Full-featured installation automation.

Parameters

Parameter Type Default Description
-Mode String all workspace, user, or all
-BackupDir String ./backups Custom backup location
-Force Switch - Skip confirmation prompts
-DryRun Switch - Preview without changes

Examples

# Standard installation
.\install-settings.ps1

# Workspace only (safe, no user settings touched)
.\install-settings.ps1 -Mode workspace -Force

# Preview what would change
.\install-settings.ps1 -DryRun

# Custom backup location
.\install-settings.ps1 -BackupDir "D:\Backups\VSCode"

# User settings only
.\install-settings.ps1 -Mode user

What It Does

  1. Validates Prerequisites
  2. Checks for source files
  3. Verifies AudioLab root

  4. Creates Backups

  5. Timestamped backup directory
  6. Copies existing settings before modification
  7. Format: backups/YYYYMMDD_HHMMSS/settings.json

  8. Installs Settings

  9. Workspace: Direct copy to .vscode/settings.json
  10. User: Intelligent merge into global settings

  11. Verifies Installation

  12. JSON syntax validation
  13. File presence checks
  14. Reports backup count

  15. Summary Report

  16. Success/failure status
  17. Backup location
  18. Next steps

📖 Settings Explained

Key Workspace Settings

C++ IntelliSense

{
  "C_Cpp.default.cppStandard": "c++20",
  "C_Cpp.errorSquiggles": "enabled",
  "C_Cpp.intelliSenseEngine": "default"
}

Why: Modern C++ features (concepts, modules, ranges) require C++20. Error squiggles catch issues early.

CMake Configure on Open

{
  "cmake.configureOnOpen": false
}

Why: Manual control prevents unwanted CMake runs when opening the workspace. Configure explicitly when ready.

File Exclusions

{
  "files.exclude": {
    "**/build": true,
    "**/.cache": true,
    "**/*.o": true
  }
}

Why: Reduces file watcher overhead, speeds up search, declutters explorer.

Format on Save

{
  "editor.formatOnSave": true,
  "[cpp]": {
    "editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd"
  }
}

Why: Enforces consistent code style automatically. Clangd uses .clang-format rules.

Terminal Profiles

{
  "terminal.integrated.profiles.windows": {
    "MSYS2": {
      "path": "C:\\msys64\\usr\\bin\\bash.exe",
      "env": { "MSYSTEM": "MINGW64" }
    }
  }
}

Why: MSYS2 provides Unix-like environment (bash, make, etc.) needed for cross-platform builds.

Key User Settings

Auto Save

{
  "files.autoSave": "onFocusChange"
}

Why: Prevents lost work when switching windows/terminals. Saves on blur.

Editor Limits

{
  "workbench.editor.limit.enabled": true,
  "workbench.editor.limit.value": 10
}

Why: Limits open editors to reduce memory usage on large projects.

Read-Only Audio Files

{
  "files.readonlyInclude": {
    "**/*.wav": true,
    "**/*.aiff": true
  }
}

Why: Prevents accidental modification of binary audio test files.

🐛 Troubleshooting

IntelliSense Not Working

Problem: Red squiggles, missing completions

Solutions:

  1. Check compiler path:

    where g++
    # Should show C:\msys64\mingw64\bin\g++.exe
    

  2. Verify vcpkg:

    C:\vcpkg\vcpkg.exe list
    

  3. Reload IntelliSense:

  4. Ctrl+Shift+P → "C/C++: Reset IntelliSense Database"
  5. Restart VS Code

  6. Check include paths:

  7. Ctrl+Shift+P → "C/C++: Edit Configurations (UI)"
  8. Verify include paths match your setup

CMake Not Configuring

Problem: CMake configure fails

Solutions:

  1. Check CMake toolchain:

    {
      "cmake.configureSettings": {
        "CMAKE_TOOLCHAIN_FILE": "C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
      }
    }
    

  2. Verify Ninja:

    where ninja
    

  3. Manual configure:

    cd build
    cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
    

  4. Check CMake output panel:

  5. View → Output → Select "CMake/Build"

Format on Save Not Working

Problem: Code doesn't format on save

Solutions:

  1. Install Clangd extension
  2. Check formatter setting:

    {
      "[cpp]": {
        "editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd"
      }
    }
    

  3. Verify .clang-format exists in project root

  4. Check Clangd status: Bottom-right of VS Code

Settings Not Applying

Problem: Changes don't take effect

Solutions:

  1. Check settings precedence:
  2. User Settings < Workspace Settings < Folder Settings

  3. View merged settings:

  4. Ctrl+Shift+P → "Preferences: Open Settings (JSON)"
  5. Compare with settings.json

  6. Clear settings cache:

  7. Close VS Code
  8. Delete %APPDATA%\Code\User\globalStorage
  9. Restart VS Code

  10. Check for JSON errors:

  11. Look for red underlines in settings files
  12. Validate with JSON linter

Terminal Not Working

Problem: MSYS2 terminal won't start

Solutions:

  1. Verify MSYS2 installation:

    Test-Path C:\msys64\usr\bin\bash.exe
    

  2. Check environment variables:

    {
      "terminal.integrated.env.windows": {
        "MSYSTEM": "MINGW64"
      }
    }
    

  3. Use PowerShell instead:

    {
      "terminal.integrated.defaultProfile.windows": "PowerShell"
    }
    

Backup Restoration

Problem: Need to restore old settings

Solution:

Backups are stored in settings/backups/YYYYMMDD_HHMMSS/

# List backups
Get-ChildItem .\backups

# Restore workspace settings
Copy-Item .\backups\20250104_123456\settings.json C:\AudioDev\audio-lab\.vscode\

# Restore user settings
Copy-Item .\backups\20250104_123456\settings.json $env:APPDATA\Code\User\

🎯 Best Practices

DO ✅

  • Install workspace settings for all team members
  • Keep user settings separate for personal preferences
  • Use format on save for consistent code style
  • Backup before modifying production settings
  • Test with dry run before full installation
  • Commit workspace settings to version control
  • Document custom changes in project README

DON'T ❌

  • Don't commit user settings (.global.json) to git
  • Don't mix personal preferences into workspace settings
  • Don't disable IntelliSense (slow but essential)
  • Don't ignore format errors (fix .clang-format instead)
  • Don't modify installed files (edit source, re-run install)
  • Don't skip backups when experimenting

🔄 Updating Settings

Workflow

  1. Edit source files (settings.json or settings.global.json)
  2. Test changes with dry run:
    .\install-settings.ps1 -DryRun
    
  3. Apply updates:
    .\install-settings.ps1 -Force
    
  4. Restart VS Code
  5. Verify settings took effect

Version Control

# Track workspace settings
git add .vscode/settings.json

# Ignore user-specific settings
echo "settings.global.json" >> .gitignore
echo "settings/backups/" >> .gitignore

📚 Additional Resources

VS Code Documentation

AudioLab Documentation

Tools Documentation

💡 Tips & Tricks

IntelliSense Performance

For large projects, limit database size:

{
  "C_Cpp.intelliSenseCacheSize": 5120,
  "C_Cpp.intelliSenseMemoryLimit": 8192
}

Multi-Root Workspaces

Working on multiple AudioLab modules:

{
  "folders": [
    { "path": "2 - FOUNDATION/04_CORE" },
    { "path": "3 - COMPONENTS/05_DSP" }
  ]
}

Keyboard Shortcuts

Add custom shortcuts in keybindings.json:

{
  "key": "ctrl+shift+b",
  "command": "cmake.build"
}

Tasks Integration

Create .vscode/tasks.json for common operations:

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Build AudioLab",
      "type": "cmake",
      "command": "build",
      "group": {
        "kind": "build",
        "isDefault": true
      }
    }
  ]
}

🏁 Next Steps

After installing settings:

  1. Install recommended extensions (see Required Extensions)
  2. Configure .clang-format for code style
  3. Set up CMake presets for build configurations
  4. Create tasks for common workflows
  5. Customize theme to your preference
  6. Join the team and share your customizations!

📞 Support

  • Issues: Report via AudioLab issue tracker
  • Questions: Ask in development chat
  • Contributions: Submit PR with improvements

Version: 1.0.0 Last Updated: 2025-01-04 Maintainer: AudioLab Infrastructure Team