Allow importing setup from other editors#325311
Draft
cwebster-99 wants to merge 10 commits into
Draft
Conversation
Detects an installed Cursor editor and offers one-click import of settings, keybindings, snippets, and extensions. Surfaces as an onboarding step for first-time users and as a notification for returning users. Adds a new externalEditorImport contrib with a detection + import service and a workbench.action.importFromExternalEditor command. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds external-editor setup import support, currently targeting Cursor.
Changes:
- Adds detection, preview, and import APIs for settings, keybindings, snippets, themes, and extensions.
- Adds commands, progress reporting, notifications, and onboarding integration.
- Adds service-level tests for detection and core import behavior.
Show a summary per file
| File | Description |
|---|---|
workbench.common.main.ts |
Loads the new contribution. |
onboardingTypes.ts |
Defines import onboarding metadata. |
onboardingVariationA.ts |
Implements the import onboarding step. |
variationA.css |
Styles the new step. |
externalEditorImportService.test.ts |
Tests detection and imports. |
externalEditorImport.ts |
Defines the service API. |
externalEditorImportService.ts |
Implements detection and importing. |
externalEditorImport.contribution.ts |
Registers commands and notifications. |
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 16
- Review effort level: Medium
Comment on lines
+59
to
+63
| readonly settingsImported: number; | ||
| readonly keybindingsImported: boolean; | ||
| readonly snippetsImported: number; | ||
| readonly extensionsInstalled: number; | ||
| readonly extensionsFailed: number; |
| return; | ||
| } | ||
|
|
||
| const rows = this._getImportRows(source).filter(row => row.available); |
Comment on lines
+1248
to
+1252
| // Only stay on the step when there was genuinely nothing to bring over. | ||
| if (!importedAnything && result.extensionsFailed === 0) { | ||
| this.notificationService.info(localize('onboarding.import.nothing', "Nothing new to import from {0}.", source.label)); | ||
| return false; | ||
| } |
Comment on lines
+736
to
+737
| private deepEqual(a: unknown, b: unknown): boolean { | ||
| return JSON.stringify(a) === JSON.stringify(b); |
Comment on lines
+576
to
+580
| for (const child of sourceStat.children) { | ||
| if (child.isDirectory) { | ||
| continue; | ||
| } | ||
| const targetUri = URI.joinPath(targetSnippetsHome, child.name); |
| parts.push(localize('externalImport.keybindings', "keyboard shortcuts")); | ||
| } | ||
| if (result.snippetsImported > 0) { | ||
| parts.push(localize('externalImport.snippetsCount', "{0} snippet files", result.snippetsImported)); |
| parts.push(localize('externalImport.snippetsCount', "{0} snippet files", result.snippetsImported)); | ||
| } | ||
| if (result.extensionsInstalled > 0) { | ||
| parts.push(localize('externalImport.extensionsCount', "{0} extensions", result.extensionsInstalled)); |
Comment on lines
+114
to
+117
| const source = sources[0]; | ||
| if (!source) { | ||
| return; | ||
| } |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Comment on lines
+493
to
+497
| const preferredHcDark = settings['workbench.preferredHighContrastColorTheme']; | ||
| const preferredHcLight = settings['workbench.preferredHighContrastLightColorTheme']; | ||
| const preferredDark = settings['workbench.preferredDarkColorTheme']; | ||
| const preferredLight = settings['workbench.preferredLightColorTheme']; | ||
| if (typeof preferredHcDark === 'string') { |
Comment on lines
+220
to
+223
| if (!token?.isCancellationRequested && selection.snippets && source.hasSnippets) { | ||
| const result = await this.importSnippets(source); | ||
| snippetsImported = result.imported; | ||
| snippetsFailed = result.failed; |
| return { imported: false, failed: true }; | ||
| } | ||
|
|
||
| const newEntries = sourceKeybindings.filter(entry => !existingKeybindings!.some(existing => equals(existing, entry))); |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
On web the path service synthesizes a home directory from the workspace root, so a repo containing e.g. .config/Cursor/User could be misidentified as an installed editor and offered as trusted import data. Skip detection entirely on web. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new "Import from External Editor" feature to the workbench, allowing users to import settings, keybindings, snippets, and extensions from other editors into VS Code. It provides both the underlying service API and the user interface integration, including notification prompts and commands.
External Editor Import Service API:
IExternalEditorImportServiceinterface and related types inexternalEditorImport.tsto support detection of external editors, previewing importable items, and performing imports.Workbench Integration and User Experience:
ExternalEditorImportServiceas a singleton and contributed a new workbench notification (ExternalEditorImportNotificationContribution) that prompts returning users to import customizations from detected editors, avoiding repeated prompts.runExternalEditorImportfunction to handle the import process, show progress notifications, and summarize results for the user.workbench.action.importFromExternalEditor: Imports from the first detected editor or informs the user if none are found.