From aea78b7370b11f5269430c256b9feaf0690a6a52 Mon Sep 17 00:00:00 2001 From: Tobias Ortmayr Date: Fri, 22 Dec 2023 14:31:44 +0100 Subject: [PATCH] Ensure that `showOpenDialog` returns correct file URI Use `URI.file` instead of manually reconstructing the URI from the received file path in plugin ext. This ensures that directories or files that contain a hash are not wrongly added to the fragment component of the URI and aligns it with the expected behavior of VS Code. Fixes #13074 Contributed on behalf of ST Microelectronics --- packages/plugin-ext/src/plugin/dialogs.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin-ext/src/plugin/dialogs.ts b/packages/plugin-ext/src/plugin/dialogs.ts index 129be4cc6e0af..9b01c120cef8f 100644 --- a/packages/plugin-ext/src/plugin/dialogs.ts +++ b/packages/plugin-ext/src/plugin/dialogs.ts @@ -41,7 +41,7 @@ export class DialogsExtImpl { if (result) { const uris = []; for (let i = 0; i < result.length; i++) { - const uri = URI.parse('file://' + result[i]); + const uri = URI.file(result[i]); uris.push(uri); } resolve(uris);