Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Extending the Manager

Step-by-step guides for adding new profiles, portable dependencies, editor editions, or settings schema entries.


1. Adding a New Optional Profile (profiles\*.ini)

No PowerShell changes are required. Create a new .ini file inside profiles\:

[Profile]
Name = Extensions: Go Development
Description = Official Go extension and portable Go toolchain.

[Settings]
go.toolsManagement.autoUpdate = true

[Extensions]
golang.go

[Dependencies]
go

Because Get-SettingsPresets scans profiles\*.ini dynamically:

  • It immediately appears in configure.ps1 Option 2.
  • It can be referenced via OptionalProfiles = ext-go in config.ini or -Preset ext-go on the CLI.
  • Update the profile list comments in config.ini, README.txt, and docs/user/profiles.md if contributing it as a built-in profile.

2. Adding a New Portable Software Dependency

Edit src/core/dependencies.ps1:

  1. Add the tool specification to Get-DependencyCatalog:
    • Use an official upstream Windows x64 portable archive (GitHub Release .zip or official JSON API).
    • Set StripSingleTopDir = $true if the archive wraps all files inside a versioned top-level directory.
    • Set SoftwareRegKey to the tool’s official Windows registry key under Software\<VendorOrProgram> (never invent a manager-specific namespace).
  2. Map extension IDs in Get-ExtensionDependencyMap:
    "publisher.extension-id" = @("my-tool")
    
  3. Add resolver logic in Resolve-ToolDownloadInfo (if not using standard "GitHubZip").
  4. Add official registry writes in Register-PortableToolEnvironmentAndRegistry under switch ($Tool.Id):
    "my-tool" {
        $null = Set-ProgramSoftwareRegistryKey -SubKey "Software\Vendor\MyTool" -Values @{
            InstallDir = $CleanDir
            Version    = $Version
        }
    }
    
  5. (Optional) Auto-wire the executable path into settings.json:
    • If the extension has an explicit binary-path setting (verify its exact package.json key!), add it to $ToolSettingKeyMap in both Get-DependencyExecutableSettingsPatch and Invoke-DependencyCheckAndInstall.
  6. Document it in README.txt and docs/user/dependencies.md.

3. Adding a New Setting to the Interactive Wizard

Edit Get-SettingsSchema in src/core/settings.ps1:

@{
    Key         = "editor.rulers"
    Category    = "Editor"
    Type        = "string"
    Default     = "[80, 120]"
    ValidValues = @()
    Description = "Vertical ruler column positions"
}

4. Adding a New Editor Edition

Edit src/core/edition.ps1:

  1. Add the edition metadata hashtable to Get-EditorProfile and Get-AllEditorProfiles (Product, Channel, DisplayName, ProgramName, ExeName, CliCmd, ProcessName, RegistryKey, MenuLabel, SourceType, endpoint info).
  2. Add executable detection in Get-InstalledEditorProfile (place more specific names like *- Insiders.exe before base names).
  3. Update the executable regex in Find-EditorPathsInRegistry (src\utility\registry.ps1) and process lists in Find-VSCodeInstalls (src\core\discovery.ps1) and Stop-EditorProcessesInDir (src\utility\filesystem.ps1).