Skip to content

Keybinding for AL: Open Externally Fails with Cannot read properties of undefined (reading 'fsPath') on RDLC Files #8174

@DiegoFlume

Description

@DiegoFlume

Issue Description

The AL: Open Externally command works correctly when activated via the context menu (right-click) on an RDLC file in the VS Code Explorer. However, when the command is executed using its assigned keybinding (Example :Alt + X), it fails to open the file and throws a warning: Cannot read properties of undefined (reading 'fsPath'

Steps to Reproduce

  1. Ensure the AL Language extension is installed and configured.
  2. Assign the keybinding Alt + X to the command AL: Open Externally.
  3. Open the VS Code Explorer sidebar.
  4. Select (click once on) an .rdlc file in the Explorer to give it focus.
  5. Press the keybinding Alt + X.

Expected Behavior

The .rdlc file should open in the external report editor configured as default (Example: Microsoft Report Builder)

Actual Behavior

A warning notification appears with the error message:

Cannot read properties of undefined (reading 'fsPath')

The external application is not launched.

Additional Notes

  • If the command is executed by right-clicking the file and selecting "AL: Open Externally" from the context menu, it works as expected.
  • This suggests the keybinding activation logic fails to properly pass the selected file's URI/context object to the command handler, resulting in an undefined resource when attempting to read the file system path (fsPath).
  • The when clause for the keybinding is set to workbench.explorer.fileview.visible. Attempts to change the when clause (e.g., to resourceSelected) stop the error from appearing but still do not execute the command.

Internal work item: AB#616575

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions