Skip to content

Add an Open Variable command to the Workspace panel context menu #337

Description

@jiqingxxm

Problem Description

The Workspace panel in the MATLAB view currently only displays each variable's name, value summary, size and class. Editing complex types such as matrices, cell arrays, structs and tables is explicitly unsupported, so the only way to inspect the full content of such a variable is to type open varname manually in the MATLAB terminal. This works, but it breaks the workflow since the user has to remember the exact variable name, switch focus to the terminal and retype it every time a different variable needs to be checked.

Proposed Solution

Add a right-click context menu entry on each item in the Workspace tree, for example 'Open Variable', that runs the equivalent of open(varname) against the connected MATLAB session, using the variable name already known to the tree item. This should not require building a new editor inside VS Code. It can simply forward to the existing open command, which already launches the native Variable Editor for complex types when run from the terminal. The same action could also be bound to double click on a tree item, matching the behavior of the Workspace browser in MATLAB Desktop.

Alternative Approaches

Typing open varname manually in the MATLAB terminal already achieves the same result, so this request is about discoverability and convenience rather than new capability. A separate idea would be building an in-VS Code grid viewer for tables and matrices similar to Data Wrangler, but that is a much larger effort and is not what this request is asking for.

Additional Context

Several closed enhancement requests (#100, #260) asked for a workspace browser equivalent to MATLAB Desktop, which the current read-only Workspace panel partially addresses. This request is a small follow-up that would close the remaining gap between viewing variable metadata and actually inspecting variable content, using functionality (open) that already exists in MATLAB.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions