mathworks / MATLAB-extension-for-vscode

This extension provides support for editing MATLAB® code in Visual Studio® Code and includes features such as syntax highlighting, code analysis, navigation support, and more.
https://marketplace.visualstudio.com/items?itemName=MathWorks.language-matlab
MIT License
241 stars 16 forks source link

No Response After Clicking the Run Button #183

Closed relifenoxiao closed 1 month ago

relifenoxiao commented 1 month ago

No Response After Clicking the Run Button

3a5aa087fe2a86706f98f478f1dcc953

As mentioned, I found that there was no response after clicking the run triangle. This issue occurs frequently, and whenever it happens, a prompt appears in the lower right corner asking me to add the current script to the MATLAB search path. After clicking "Add to Path," the script can run. However, as shown below, my script is already in the MATLAB search path, so I thought this should not be an issue and disabled the prompt.

c747c5fe18fc2372e48d5a8546a8ca7d e4464bdcd858a6491f74813f2de95407

After losing this warning, I found that I could no longer run any scripts. I can still run commands in the terminal.

To resolve this issue, I tried the following methods:

2024-10-05 22:13:01.288 [error] [Extension Host] Telemetry post error:  FetchError: request to https://udc-service.mathworks.com/udc/service/v1/events failed, reason: connect ETIMEDOUT 198.18.5.47:443
    at ClientRequest.<anonymous> (c:\Users\27161\.vscode\extensions\mathworks.language-matlab-1.2.6\node_modules\node-fetch\lib\index.js:1505:11)
    at ClientRequest.emit (node:events:531:35)
    at TLSSocket.socketErrorListener (node:_http_client:500:9)
    at TLSSocket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at processTicksAndRejections (node:internal/process/task_queues:82:21)

My Request

I am currently unable to resolve this issue and cannot determine if it is a bug. Please guide me or tell me how to fix it.

My device is:

Version: Windows 11 Home (Chinese)
Version Number: 23H2
OS Build: 22631.4249
Serial Number: PF3JBZE9
Experience: Windows Feature Experience Pack 1000.22700.1041.0
relifenoxiao commented 1 month ago

"The current state is that I have reset my system to the previous backup point, and everything is back to normal; the scripts run without errors. I also learned that not all configurations of VS Code are stored in the Settings. I rolled back all the recently modified configurations, but this didn’t take effect until I reset my system."

philipb314 commented 1 month ago

I am glad you were able to resolve the issue. It sounds like the file was not on the path. This could be verified by running ">> which do" and seeing what file, if any, is being reported.

relifenoxiao commented 1 month ago

image

which do has the same output as the pwd command, which matches the file path I mentioned earlier when it couldn't run.

Both are located in MATLAB's search path. However, just because they are the same now doesn't mean the output was the same when I ran the script earlier.

Perhaps pwd shows the location of the terminal I opened, while the terminal executed the file from a different location.

But the script is indeed located in the path shown by the previous pwd command.

This is puzzling because it happens inconsistently. Since I am not familiar with the which do command, I'll leave it to you to judge.