mathworks / mathworks/MATLAB-extension-for-vscode

Opening a MATLAB Project breaks the Workspace panel's live data updates (independent of startup/shutdown script content)

Open
#350 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
435
Forks
40
PR merge metrics
No merged PRs in 30d

Description

Environment
• Extension: MATLAB (MathWorks), version 1.3.13
• MATLAB: R2025b Update 6 (25.2.0.3312555)
• OS: Windows

Summary
After opening a MATLAB Project (.prj) — either via MATLAB: Open Project... or by typing open('project.prj') in the MATLAB command window — the Workspace panel (workspaceBrowserSidebarView) stops receiving any variable updates. New variables assigned afterward in the base workspace never appear in the panel, even though they genuinely exist (verified by evaluating them directly in the MATLAB terminal).

Steps to Reproduce

  1. Fresh MATLAB session (disconnect/reconnect via MATLAB: Change MATLAB Connection to guarantee a clean state).
  2. Confirm the Workspace panel is live: type testVar1 = 1; in the MATLAB terminal → appears correctly in the panel.
  3. Open a MATLAB Project,
  4. Type testVar2 = 1; in the MATLAB terminal.
  5. Expected: testVar2 appears in the Workspace panel.
  6. Actual: Panel does not update at all — testVar2 never appears, and no further variables update either.
    Isolation performed
    • Confirmed reproducible with the project's registered startup file present.
    • Confirmed reproducible even after stripping the startup file down to trivial fprintf/setenv statements only (ruled out clear, currentProject, gitrepo, sl_refresh_customizations, slCharacterEncoding as the specific trigger).
    • Confirmed reproducible even with the startup file fully unregistered from the project (Project → Details → Startup/Shutdown Files). So the break is tied to the act of opening the project itself, not to any startup/shutdown script content.
    • Confirmed with almost empty project file test.prj
    • Not related to the previously fixed issue #332 (clear followed by long-running op) — that fix is present in 1.3.13 and works correctly for plain scripts; this is a distinct trigger.
    • No errors observed in Developer Tools Console or the Extension Host log during reproduction.
    Workaround
    • Disconnect and reconnect MATLAB (MATLAB: Change MATLAB Connection) after opening the project restores normal Workspace panel updates for the rest of the session (until the project is reopened again).
    Suspected root cause
    The Workspace panel's data-refresh mechanism relies on detecting MATLAB "idle" prompt-change events to re-prime/request data (see WorkspaceBrowserProvider.ts, schedulePrime/requiresPrime). Project loading likely changes MATLAB's busy/idle state transitions in a way the extension doesn't recognize as a normal idle event, so the panel's internal request loop never resumes.

test.prj.txt

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in WorkspaceBrowserProvider.ts, especially schedulePrime/requiresPrime and the workspace refresh path, then reproduce by opening test.prj and assigning a new variable. Done means variables assigned after project opening appear in the Workspace panel without disconnecting and reconnecting MATLAB; verify with the supplied steps and an almost empty project.

Written by the indexing model from the issue text.

Assessment

Tech stack
matlab, typescript, vscode
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.