Skip to content

Commit 68cb055

Browse files
authored
Fix incorrect URI conversions in custom-editors-main.ts (#13653)
1 parent 9c9456b commit 68cb055

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/plugin-ext/src/main/browser/custom-editors/custom-editors-main.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,14 @@ export class CustomEditorsMainImpl implements CustomEditorsMain, Disposable {
139139
widget.onMove(async (newResource: TheiaURI) => {
140140
const oldModel = modelRef;
141141
modelRef = await this.getOrCreateCustomEditorModel(modelType, newResource, viewType, onMoveCancelTokenSource.token);
142-
this.proxy.$onMoveCustomEditor(identifier.id, URI.file(newResource.path.toString()), viewType);
142+
this.proxy.$onMoveCustomEditor(identifier.id, newResource.toComponents(), viewType);
143143
oldModel.dispose();
144144
});
145145
}
146146

147147
const _cancellationSource = new CancellationTokenSource();
148148
await this.proxy.$resolveWebviewEditor(
149-
URI.file(resource.path.toString()),
149+
resource.toComponents(),
150150
identifier.id,
151151
viewType,
152152
this.labelProvider.getName(resource)!,
@@ -309,7 +309,7 @@ export class MainCustomEditorModel implements CustomEditorModel {
309309
editorPreferences: EditorPreferences,
310310
cancellation: CancellationToken,
311311
): Promise<MainCustomEditorModel> {
312-
const { editable } = await proxy.$createCustomDocument(URI.file(resource.path.toString()), viewType, {}, cancellation);
312+
const { editable } = await proxy.$createCustomDocument(resource.toComponents(), viewType, {}, cancellation);
313313
return new MainCustomEditorModel(proxy, viewType, resource, editable, undoRedoService, fileService, editorPreferences);
314314
}
315315

@@ -339,7 +339,7 @@ export class MainCustomEditorModel implements CustomEditorModel {
339339
}
340340

341341
get resource(): URI {
342-
return URI.file(this.editorResource.path.toString());
342+
return URI.from(this.editorResource.toComponents());
343343
}
344344

345345
get dirty(): boolean {
@@ -441,7 +441,7 @@ export class MainCustomEditorModel implements CustomEditorModel {
441441
async saveCustomEditorAs(resource: TheiaURI, targetResource: TheiaURI, options?: SaveOptions): Promise<void> {
442442
if (this.editable) {
443443
const source = new CancellationTokenSource();
444-
await this.proxy.$onSaveAs(this.resource, this.viewType, URI.file(targetResource.path.toString()), source.token);
444+
await this.proxy.$onSaveAs(this.resource, this.viewType, targetResource.toComponents(), source.token);
445445
this.change(() => {
446446
this.savePoint = this.currentEditIndex;
447447
});
@@ -561,7 +561,7 @@ export class CustomTextEditorModel implements CustomEditorModel {
561561
}
562562

563563
get resource(): URI {
564-
return URI.file(this.editorResource.path.toString());
564+
return URI.from(this.editorResource.toComponents());
565565
}
566566

567567
get dirty(): boolean {

0 commit comments

Comments
 (0)