Skip to content

Latest commit

 

History

History
107 lines (75 loc) · 3.98 KB

File metadata and controls

107 lines (75 loc) · 3.98 KB

Add Support for Disabled Extensions Synchronization

Description

This PR implements support for synchronizing disabled extensions in VSCode Settings Sync, resolving Issue #143.

Problem

Previously, VSCode Settings Sync could not synchronize the disabled state of extensions. When users disabled extensions on one machine, those extensions would remain enabled when synced to another machine, causing inconsistent development environments.

Solution

The implementation adds comprehensive support for disabled extension synchronization by:

  1. Detection: Reading VSCode's internal settings to identify disabled extensions
  2. Storage: Including disabled extension state in sync data
  3. Restoration: Automatically restoring disabled states during download

Changes Made

New Files

  • src/service/disabledExtension.service.ts - Core service for disabled extension handling
  • test/disabledExtension.test.ts - Comprehensive test suite
  • DISABLED_EXTENSIONS_FEATURE.md - Detailed documentation

Modified Files

  • src/service/plugin.service.ts - Enhanced ExtensionInformation model and sync logic
  • src/sync.ts - Integrated disabled extension restoration into download workflow

Key Features

Cross-platform support - Works on Windows, macOS, and Linux
Global and workspace-level - Supports both global and workspace-disabled extensions
Backward compatible - No breaking changes to existing functionality
Error handling - Graceful handling of missing config files and sync errors
User feedback - Progress indication and error reporting
Comprehensive tests - Full test coverage for new functionality

Technical Details

Extension Information Model

export class ExtensionInformation {
  // Existing properties...
  public disabled?: boolean; // True if disabled in any way
  public disabledGlobally?: boolean; // True if disabled globally
  public disabledInWorkspace?: boolean; // True if disabled in workspace
}

Disabled Extension Detection

The service reads VSCode's settings.json files to detect disabled extensions:

  • Global: %APPDATA%/Code/User/settings.json (Windows) or equivalent
  • Workspace: <workspace>/.vscode/settings.json

Sync Workflow

  1. Upload: CreateExtensionList() includes disabled extension states
  2. Download: RestoreDisabledExtensions() restores states after installation

Testing

  • ✅ Unit tests for disabled extension detection
  • ✅ Integration tests for sync workflow
  • ✅ Error handling tests
  • ✅ Cross-platform compatibility tests
  • ✅ Backward compatibility tests

Breaking Changes

None. This is a purely additive feature that maintains full backward compatibility.

Issue Resolution

Closes #143 - Considering disabled extensions

Bounty Information

This PR resolves the $120 IssueHunt bounty for Issue #143.

How to Test

  1. Install some extensions in VSCode
  2. Disable some extensions globally (right-click → "Disable")
  3. Disable some extensions in workspace (right-click → "Disable (Workspace)")
  4. Upload settings using Settings Sync
  5. On another machine, download settings
  6. Verify that disabled extensions are properly restored in their disabled state

Screenshots/Demo

The feature works transparently - users will see disabled extensions properly synchronized with appropriate status messages in the output channel.

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Comments added for complex logic
  • Tests added for new functionality
  • Documentation updated
  • No breaking changes introduced
  • Backward compatibility maintained
  • Error handling implemented
  • Cross-platform compatibility ensured

Additional Notes

This implementation provides a robust foundation for disabled extension synchronization while maintaining the simplicity and reliability that users expect from VSCode Settings Sync. The feature works automatically without requiring any additional configuration from users.