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

matlab-ls repeated launch and crush #116

Open yutaka-shoji opened 3 months ago

yutaka-shoji commented 3 months ago

Describe the bug

It seems that an error occurs when the matlab-language-server connects with MATLAB. When checking the logs of matlab-ls from the output of VSCode, the following output was observed:

ReferenceError: location is not defined
~~~~~~~~

Versions:

dklilley commented 3 months ago

Thanks for reporting this!

Can you share the log files?

yutaka-shoji commented 3 months ago

With neovim lsp usage, the log is same

yutaka-shoji commented 3 months ago

Thank you for response. The log is here.

VSCode Version Detail Version: 1.87.2 (user setup) Commit: 863d2581ecda6849923a2118d93a088b0745d9d6 Date: 2024-03-08T15:20:17.278Z Electron: 27.3.2 ElectronBuildId: 26836302 Chromium: 118.0.5993.159 Node.js: 18.17.1 V8: 11.8.172.18-electron.0 OS: Windows_NT x64 10.0.19044

(09:40:05) matlabls: Log Directory: C:\Users\[USERNAME]\AppData\Local\Temp\matlabls_26740
(10:09:32) matlabls: Launching MATLAB...
(10:09:57) matlabls: Started MATLAB
c:\Users\[USERNAME]\.vscode\extensions\mathworks.language-matlab-1.2.0\server\out\index.js:17154
((()=>{var...[long-lasting output...(content from mathworks.language-matlab-1.2.0\server\out\index.js:17154)]

ReferenceError: location is not defined
    at Object.parse (c:\Users\[USERNAME]\.vscode\extensions\mathworks.language-matlab-1.2.0\server\out\index.js:17154:116119)
    at _0x3bbfcf.initialize (c:\Users\[USERNAME]\.vscode\extensions\mathworks.language-matlab-1.2.0\server\out\index.js:17154:84604)
    at new _0x3bbfcf (c:\Users\[USERNAME]\.vscode\extensions\mathworks.language-matlab-1.2.0\server\out\index.js:17154:103265)
    at c:\Users\[USERNAME]\.vscode\extensions\mathworks.language-matlab-1.2.0\server\out\index.js:17154:94539
    at Function.isUsable (c:\Users\[USERNAME]\.vscode\extensions\mathworks.language-matlab-1.2.0\server\out\index.js:17154:87533)
    at c:\Users\[USERNAME]\.vscode\extensions\mathworks.language-matlab-1.2.0\server\out\index.js:17154:94369
    at _0x3eb3ef (c:\Users\[USERNAME]\.vscode\extensions\mathworks.language-matlab-1.2.0\server\out\index.js:17154:102181)
    at c:\Users\[USERNAME]\.vscode\extensions\mathworks.language-matlab-1.2.0\server\out\index.js:17154:102405
    at _0x1d64e9 (c:\Users\[USERNAME]\.vscode\extensions\mathworks.language-matlab-1.2.0\server\out\index.js:17154:102462)
    at Object.asyncEach (c:\Users\[USERNAME]\.vscode\extensions\mathworks.language-matlab-1.2.0\server\out\index.js:17154:102468)

Node.js v18.17.1
[Info  - 10:09:57 AM] Connection to server got closed. Server will restart.
true
(10:09:58) matlabls: Log Directory: C:\Users\[USERNAME]\AppData\Local\Temp\matlabls_31196
dklilley commented 3 months ago

Hi @yutaka-shoji, can you try this again with the new release of the extension (v1.2.1) and let us know if you are still encountering this issue?

yutaka-shoji commented 3 months ago

@dklilley Thank you for response and your work! However, my vscode still does not seem to be able to connect to MATLAB. (Is anyone else experiencing this problem?)

vscode matlab-language-server log here.

(14:25:08) matlabls: Log Directory: C:\Users\[username]\AppData\Local\Temp\matlabls_34312
(14:25:13) matlabls: Launching MATLAB...
(14:25:35) matlabls: Started MATLAB (session 1)
(14:25:35) matlabls: MATLAB session 1 connected to R2023b
c:\Users\[username]\.vscode\extensions\mathworks.language-matlab-1.2.1\server\out\index.js:23865
((()=>{var _0x3...
ReferenceError: location is not defined
    at Object.parse (c:\Users\[username]\.vscode\extensions\mathworks.language-matlab-1.2.1\server\out\index.js:23865:116283)
    at _0x31972a.initialize (c:\Users\[username]\.vscode\extensions\mathworks.language-matlab-1.2.1\server\out\index.js:23865:84799)
    at new _0x31972a (c:\Users\[username]\.vscode\extensions\mathworks.language-matlab-1.2.1\server\out\index.js:23865:103434)
    at c:\Users\[username]\.vscode\extensions\mathworks.language-matlab-1.2.1\server\out\index.js:23865:94753
    at Function.isUsable (c:\Users\[username]\.vscode\extensions\mathworks.language-matlab-1.2.1\server\out\index.js:23865:87733)
    at c:\Users\[username]\.vscode\extensions\mathworks.language-matlab-1.2.1\server\out\index.js:23865:94583
    at _0x45cb9b (c:\Users\[username]\.vscode\extensions\mathworks.language-matlab-1.2.1\server\out\index.js:23865:102363)
    at c:\Users\[username]\.vscode\extensions\mathworks.language-matlab-1.2.1\server\out\index.js:23865:102580
    at _0x4f3304 (c:\Users\[username]\.vscode\extensions\mathworks.language-matlab-1.2.1\server\out\index.js:23865:102630)
    at Object.asyncEach (c:\Users\[username]\.vscode\extensions\mathworks.language-matlab-1.2.1\server\out\index.js:23865:102636)

Node.js v18.17.1
[Info  - 2:25:35 PM] Connection to server got closed. Server will restart.
true
(14:25:35) matlabls: Log Directory: C:\Users\[username]\AppData\Local\Temp\matlabls_27060
dklilley commented 2 months ago

Thank you for trying this! Unfortunately, we have not been able to reproduce this ourselves, and have not received any other reports of this.

yutaka-shoji commented 2 months ago

@dklilley Thanks for the reply. I reinstalled vscode just to be sure, but it did not solve the problem. What is this error around?The js code in the source is obfuscated, so I have no idea what the error is from my end.

YiZhiRikka commented 1 month ago

Same problem with same vscode matlab-language-server log. The MATLAB started 5 times successfully seen from task manager but MATLAB language server crashed 5 times. image

MATLAB R2024a Latest VSCode and extension Windows 10