mathworks / mathworks/MATLAB-extension-for-vscode
Add an Open Variable command to the Workspace panel context menu
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 435
- Forks
- 40
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the Workspace panel's tree-item and context-menu implementation, then trace how commands are forwarded to the connected MATLAB terminal. Add an Open Variable action using the selected item's variable name, and verify that it invokes MATLAB's existing open command for complex variables without adding an in-editor viewer.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100