Microsoft/vscode

Untitled custom editor in web version

Open

#141,801 建立於 2022年1月29日

在 GitHub 查看
 (0 留言) (0 反應) (1 負責人)TypeScript (10,221 fork)batch import
bugcustom-editorshelp wanted

倉庫指標

Star
 (74,848 star)
PR 合併指標
 (平均合併 11小時 43分鐘) (30 天內合併 1,000 個 PR)

描述

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.

貢獻者指南