Skip to content

Fix save locations for untitled custom editors in virtual workspaces - #343326

Closed
Arham Begani (Arham-Begani) wants to merge 1 commit into
microsoft:mainfrom
Arham-Begani:fix/untitled-custom-editor-save-path
Closed

Arham Begani (Arham-Begani) wants to merge 1 commit into
microsoft:mainfrom
Arham-Begani:fix/untitled-custom-editor-save-path

Conversation

@Arham-Begani

Copy link
Copy Markdown

Fixes #141801.

An extension can open a new custom document with a relative URI such as untitled:Untitled-1.custom. In a virtual workspace, Save converts its scheme but leaves the authority empty and the path relative. Save As passes the untitled URI directly to the dialog. Neither uses the workspace's default save directory.

This resolves relative untitled paths against IFileDialogService.defaultFilePath() before opening either save dialog, following the existing notebook save-path approach. Explicit absolute paths and authorities retain their existing behavior.

Validation

  • Reproduced against upstream 13d3bd453cfcb803650fa2a5cb18ca5c47f534a2: both new save-location tests fail because the suggested URI has the wrong authority/path; all 14 existing tests pass. Baseline run.
  • Fixed-source validation: all 22 tests pass in Chromium on both Ubuntu 24.04 and Windows Server 2025, using Node 24.22.0. The client build passes on both; client type checking, ESLint and hygiene for the three changed files pass on Linux. The validated patch matches commit 72405876.
  • Regression coverage exercises Save and Save As with a virtual workspace, explicit local/virtual paths, and cancellation that preserves unsaved changes. The tests exercise the custom-editor lifecycle and extension-host save callback with a stubbed file dialog; they are not a manual github.dev session.

AI assistance was used for the investigation, implementation, and tests.

To run the focused suite after setting up the repository and Chromium:

npm run build-fast -- --client-only
npm run test-browser-no-install -- --browser chromium --run src/vs/workbench/api/test/browser/mainThreadCustomEditors.test.ts

Copilot AI balanced review requested due to automatic review settings October 21, 2026 19:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Note

This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.

@Arham-Begani

Copy link
Copy Markdown
Author

Arham Begani (Arham Begani (@Arham-Begani)) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

@Arham-Begani

Copy link
Copy Markdown
Author

Matt Bierner (@mjbvz), the focused fix for #141801 is ready for review at 72405876.

The CLA and dependency checks pass. VS Code PR Check reports that it is waiting for collaborator approvals (0/3), and the Code OSS, Monaco, Component Fixtures, Telemetry and CodeQL workflows report action_required. Could you review the fix and authorize the upstream workflows when appropriate?

The linked before/after runs in the description reproduce both save-path failures, then pass all 22 Chromium tests on Linux and Windows with the fix. Client type checking, changed-file lint and hygiene also pass. Those fork results are separate from the pending upstream checks.

This status update was prepared with AI assistance.

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.

Untitled custom editor in web version

2 participants