Microsoft/vscode

Untitled custom editor in web version

Aperta

#141.801 aperta il 29 gen 2022

 (0 commenti) (0 reazioni) (1 assegnatario)TypeScript (39.847 fork)batch import
bugcustom-editorshelp wanted

Metriche repository

Star
 (184.936 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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.

Guida contributor