Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error and warning detection stops working after a while #204

Open
jecs opened this issue Jan 16, 2025 · 11 comments
Open

Error and warning detection stops working after a while #204

jecs opened this issue Jan 16, 2025 · 11 comments
Labels
bug Something isn't working

Comments

@jecs
Copy link

jecs commented Jan 16, 2025

Describe the bug
After using VSCode for a while (usually 30 minutes+), syntax highlighting error and warning detection stops working (i.e. I get false positives and generic errors). The only way to remedy this issue is to "disconnect" from Matlab and then connect again. It seems that the instance tied to syntax formatting error and warning detection hangs or becomes unresponsive for some reason. Instances of Matlab remain open even after disconnecting, requiring force quitting the old instances.

To Reproduce
Steps to reproduce the behavior:

  1. Use Matlab extension in VSCode for an extended period.
  2. Wait until error detection breaks.
  3. Disconnect and reconnect from Matlab to "fix" issue.

Expected behavior
I would expect error and warning detection to work flawlessly and not to require constantly needing to disconnect and connect to new instances of Matlab.

Useful Information

  • MATLAB version: R2024b Update 3 (24.2.0.2803551)
  • OS Version: macOS 15.2 (24C101)
  • VS Code Version: Version: 1.96.3

Additional context
This has been an issue for as long as I have used this extension. It happens even when using the ssh plugin to run the extension on a remote Linux server. It doesn't seem to be an issue with VSCode's version and it doesn't seem to be unique to macOS, though I guess that it could be a problem with the macOS VSCode client itself. I should also add that I am using the "New Desktop" addon in Matlab locally but not on the Linux machine.

@jecs jecs added the bug Something isn't working label Jan 16, 2025
@dklilley
Copy link
Member

Hi @jecs , thanks for reporting this!

I haven't seen this myself, and it is odd that this is corrected by disconnecting/reconnecting to MATLAB. Syntax highlighting should be handled by VS Code natively, and nothing from the MATLAB application should be impacting syntax highlighting.

It does sound that MATLAB is occasionally freezing in some way, hence needing to force-quit old instances.

Can you please share the following:

  1. A screenshot of the syntax highlighting issue you are seeing
  2. Any generated output logs from a session which encountered this issue

@jecs
Copy link
Author

jecs commented Jan 16, 2025

Hi, @dklilley.

Thanks for the prompt response.

Ah, I just realized that I did not describe the problem 100% accurately: It's not syntax highlighting itself but the highlighting of errors and warnings with yellow and red that stops working.

I will edit the title of this bug report. I will also send you a screenshot and logs when this issue pops up again (it can be quite random).

@jecs jecs changed the title Syntax highlighting stops working after a while Error and warning detection stops working after a while Jan 16, 2025
@dklilley
Copy link
Member

That makes more sense, thanks for the clarification!

In the log directory, there should be a matlabLog.txt file - this may be helpful as it may show errors which occurred on the MATLAB side.

@jecs
Copy link
Author

jecs commented Jan 16, 2025

The error has happened today, and I believe that the matlabLog.txt reflects that. I attach it here. The new instance of Matlab starts after disconnecting and then connecting midway in the file.

matlabLog.txt

I'll attach a screenshot or .gif when the issue pops up again.

@jecs
Copy link
Author

jecs commented Jan 16, 2025

It happened again. Here I attach a .gif showing how the issue affects VSCode, the latest matlabLog.txt, and a small image showing the many instances of MATLAB.

Image

matlabLog.txt

Image

@dklilley
Copy link
Member

Thanks for the extra information and the logs! Unfortunately, I don't see anything related in the logs, but it does seem that MATLAB might be hanging.

  • Have you encountered any issue with hangs while using MATLAB directly (not through the VS Code extension)?
  • Are you working within a workspace in VS Code? If so, approximately how many MATLAB files are within it?

@jecs
Copy link
Author

jecs commented Jan 17, 2025

  • I have not encountered any issues with hangs while using MATLAB directly.
  • Yes, I am working within a workspace. Not too many. About 12 .m files, but I am only working on 2-3.

@jecs
Copy link
Author

jecs commented Jan 28, 2025

That latest update might have fixed the issue. I will keep using the extension and let you know in a day or two whether the issue pops up again.

I spoke too soon. The issue just popped up again.

@dklilley
Copy link
Member

Thanks for the confirmation. Something seems to be happening on the MATLAB side which is causing it to hang or otherwise become unresponsive. Unfortunately, I haven't been able to determine anything from the extension's logs.

I would suggest reaching out to MathWorks Support, as they will have other diagnostics which they can try.

@jecs
Copy link
Author

jecs commented Jan 29, 2025

Thanks, @dklilley. I will reach out to them.

The request was assigned Case Number 07577589.

@jecs
Copy link
Author

jecs commented Jan 31, 2025

I'm in the middle of working through this issue with support. No luck so far.

However, I did notice that the extension seems to have a bit of trouble with paths.

languageServerLog.txt

(12:48:14) matlabls: Launching MATLAB...
(12:48:17) matlabls: Started MATLAB (session 2)
(12:48:17) matlabls: MATLAB session 2 connected to R2024b
(12:48:17) matlabls: CWD set to: Users/josecs/dev/project
(12:48:17) matlabls: Adding workspace folder(s) to the MATLAB Path: 
	Users/josecs/dev/project

matlabLog.txt

...
matlabls: Beginning initialization
matlabls: matlabroot is 
/Applications/MATLAB_R2024b.app
Printing connection data to file:/var/folders/yt/zdf2yqds1sj8fg68_qqvy86h0000gq/T/matlabls_17115/matlabls_conn.json
matlabls: Initialization complete
Error during `cd` operation:
Unable to change current folder to '/Users/josecs/dev/project/Users/josecs/dev/project' (Name is nonexistent or not a folder).
[�Warning: Name is nonexistent or not a directory:
/Users/josecs/dev/project/Users/josecs/dev/project]�
[�> In path (line 109)
In addpath>doPathAddition (line 126)
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants