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
215 stars 13 forks source link

Error Connecting to VSCode #139

Open Oatu4396 opened 2 months ago

Oatu4396 commented 2 months ago

I'm currently running MATLAB 2024a on MacOS Sonoma 14.2.1, with 1.2.1 MATLAB VSCode extension.

Each time I open VSCode the MATLAB Language Server shows

(01:23:48) matlabls: Launching MATLAB... (01:23:48) matlabls: MATLAB process (session 1) terminated (01:23:48) matlabls: Shutting down MATLAB session 1

and I've met the same problem on MATLAB 2023b so I believe it's not a version bug. Also, it should not be my path setting problem since it seems to successfully start MATLAB process but immediately shut down.

Oatu4396 commented 2 months ago

In the matlabLog.txt, it shows /Applications/MATLAB_R2024a.app/bin/matlab: line 397: awk: command not found /Applications/MATLAB_R2024a.app/bin/matlab: line 413: expr: command not found

I've checked my PATH and /usr/bin is inside. and also, awk and expr commands are valid:

image
dklilley commented 2 months ago

Hi @Oatu4396, thanks for raising this issue.

Can you share the following info?

  1. The log files from the MATLAB language server (the log directory can be found at the top of the output log)
  2. The value of your install path setting
  3. Is your system maca or maci?
  4. Is your MATLAB installation maca or maci? In /Applications/MATLAB_R2024a.app/bin, do you see a maca or a maci directory?
  5. Do you see any errors if you launch MATLAB from the terminal using the following command? /Applications/MATLAB_R2024a.app/bin/matlab -log -memmgr release -noAppIcon -nosplash -useStartupFolderPref -nodesktop This is similar to how MATLAB is launched by the language server.
Oatu4396 commented 2 months ago

1. (11:01:50) matlabls: Log Directory: /var/folders/yb/bv4x7p390pz0hydvmmn1xmjw0000gp/T/matlabls_7719 (11:01:50) matlabls: Launching MATLAB... (11:01:50) matlabls: MATLAB process (session 1) terminated (11:01:50) matlabls: Shutting down MATLAB session 1

2. /Applications/MATLAB_R2024a.app

3. M1 Mac.

4. maca version. maca64 folder is inside.

5. The terminal successfully starts MATLAB.

image
bobbyocean commented 1 month ago

I am getting the exact same errors as @Oatu4396. I am on RedHatEnterprise 8.9. MATLAB extensions 1.2.1. VScode 1.85.1. VScode remote SSH 0.107.1. I have reinstalled multiple times. I have tried matlab/r2021a, r2021b, r2022a, r2022b, r2023a, r2023b, and they all produce the same error. I have also rm -rf .vscode-server and reinstalled. I can successfully launch matlab -nodisplay just fine on the remote server. I also get the same output as @Oatu4396 when running the matlab -log -memmgr release -noAppIcon -nosplash -useStartupFolderPref -nodesktop command in the terminal or in the vscode-terminal.

Only two files in matlabls_1496100 got created, matlabLog.txt and languageServerLog.txt. The file matlabls_conn.json was never created. Here is a dump of all files in the temp folder:

image

Here is what the top of the VSCODE-OUTPUT section looks:

image (1000+ lines of java code) image