Skip to content

showOpenDialog() returns object with path and fragment properties different from VS Code #13074

@SamuelBergSTM

Description

@SamuelBergSTM

Bug Description:

When selecting a file or folder using vscode.window.showOpenDialog(), fragments and paths are handled differently in Theia compared to VS Code.
Theia adds the part after the hash (#) to the fragment property of the vscode.Uri object, while VS Code appends it to the path property instead.

Steps to Reproduce:

  1. Show a folder / file selector using vscode.window.showOpenDialog and await user response.
  2. Select and open a folder / file path that includes a hash (#) (e.g. 'c:/example/#path').
  3. Inspect the received vscode.Uri object properties.

Example:

const selectedUris = await vscode.window.showOpenDialog({ canSelectMany: false, canSelectFolders: true });
console.log(selectedUris?.[0]);

Additional Information

  • Operating System: Windows 10 Enterprise
  • Theia Version: 1.43.0

Theia vscode.Uri object path and fragment properties:
path: '/c:/example/'
fragment: 'path'

VS Code vscode.Uri object path and fragment properties:
path: '/C:/example/#path'
fragment: ''

Metadata

Metadata

Assignees

No one assigned

    Labels

    vscodeissues related to VSCode compatibility

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions