Microsoft/vscode

Untitled custom editor in web version

Open

#141,801 opened on Jan 29, 2022

View on GitHub
 (0 comments) (0 reactions) (1 assignee)TypeScript (10,221 forks)batch import
bugcustom-editorshelp wanted

Repository metrics

Stars
 (74,848 stars)
PR merge metrics
 (Avg merge 11h 43m) (1,000 merged PRs in 30d)

Description

When opening an untitled uri in the web version (at least on github.dev), the authority must be set for the untitled uri for the new untitled document to be savable (the saving code takes the authority from the untitled uri and the save dialog will error if the authority is wrong). TextDocument doesn't seem to have this issue since it gets its preferred path from the file dialog default path. CustomDocument doesn't seem to go through the same code path.

This is somewhat related to https://github.com/microsoft/vscode/issues/141561 (since both are related to generating the right untitled uri) and I believe even if no behavior change is needed, the current behavior should at least be documented. Ideally there should also be a way for the custom editor to provide a preferred saving path for untitled documents as well (also related to #141561) and also to access the file dialog default path so that it can reach feature parity with text editors.

Contributor guide