mathworks / mathworks/MATLAB-extension-for-vscode

Warnings shown for files not opened in editor

Open
#80 3 comments 0 reactions 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

When a new file is opened in the editor, MATLAB populates the "Problems" panel with its warnings and errors. For example, when a built-in function is opened in the editor (by clicking "Go To Definition" or by ctrl+clicking the function name), its code opens in the editor and we may see a couple warnings. We expect these warnings to leave the "Problems" panel once the file is closed.

However, there is a weird bug where these warnings do not go away even after closing the file. Here I have a script which contained the addpath(), genpath(), and imgaussfilt() functions. None of these files were open in the editor, yet the warnings are still shown (seen below).

Screenshot 2024-01-05 at 4 20 28 PM 2

The warnings appear even if I just ctrl+hover over the function names. It doesnt always happen, but in most cases it does. What more, sometimes you will see functions that were called by the built-in function. In the screenshot below, imgaussfilt.m is not there, but another file KernelDistribution.m is shown, even though it was never opened in the editor.

Screenshot 2024-01-05 at 4 36 10 PM 2

The appropriate behavior, in my opinion, should be to either

  • Show only warnings/errors for files currently open
  • Show warnings/errors for all files in the workspace, but exclude built-ins

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

Reproduce the issue in VS Code using a script with addpath(), genpath(), and imgaussfilt(), then compare Problems-panel contents after ctrl-hover, Go To Definition, and closing the opened file. Trace the warning lifecycle from these editor actions and verify that warnings for closed or built-in files no longer remain, while confirming the intended workspace behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.