Skip to content

Include installed extensions missing from VS Code API#1462

Open
landeqiming666 wants to merge 1 commit into
shanalikhan:masterfrom
landeqiming666:codex/issue-143-sync-disabled-extensions
Open

Include installed extensions missing from VS Code API#1462
landeqiming666 wants to merge 1 commit into
shanalikhan:masterfrom
landeqiming666:codex/issue-143-sync-disabled-extensions

Conversation

@landeqiming666
Copy link
Copy Markdown

Short description of what this resolves:

This adds a conservative first step for #143: when building extensions.json, Settings Sync now also reads installed extension package.json files from the VS Code extensions folder and merges any extensions that are installed on disk but not returned by the VS Code extension API.

That covers the user-facing failure mode discussed in #143 where disabled extensions can be omitted from upload and then treated as missing on another machine. This does not try to write VS Code's disabled-extension internals or restore enable/disable state; it keeps the change limited to preserving the installed extension list.

Changes proposed in this pull request:

  • Add InstalledExtensionsService for pure package.json-based extension discovery.
  • Reuse that service from PluginService.CreateExtensionList() after collecting API-visible extensions.
  • Deduplicate by publisher.name so API-visible extensions keep their existing metadata.
  • Add focused tests for including disk-only installed extensions and avoiding duplicates.

How Has This Been Tested?

  • npm run tslint-check
  • git -c core.whitespace=cr-at-eol diff --check
  • Targeted compile/test for the new pure service:
    • ./node_modules/.bin/tsc --target es5 --module commonjs --moduleResolution node --lib es2015,es2016,es2017,es2018,esnext,dom --types node,chai,mocha --skipLibCheck --outDir /tmp/code-settings-sync-test-out src/service/installedExtensions.service.ts test/service/pluginService/pluginService.test.ts
    • NODE_PATH="$PWD/node_modules" ./node_modules/.bin/mocha --recursive "/tmp/code-settings-sync-test-out/test/service/pluginService/**/*.js"

Note: a full fresh npm test currently fails before reaching this change because the unpinned dependency tree installs newer @octokit/rest / type packages that no longer match the repository's TypeScript 3.x code (github.oauth.service.ts fetch typing and github.service.ts Octokit response types). I left package metadata untouched.

Checklist:

  • I have read the contribution guidelines.
  • My change requires a change to the documentation and GitHub Wiki.
  • I have updated the documentation and Wiki accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant