MATLAB-extension-for-vscode icon indicating copy to clipboard operation
MATLAB-extension-for-vscode copied to clipboard

matlab-ls repeated launch and crush

Open yutaka-shoji opened this issue 11 months ago • 8 comments

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:

  • MATLAB R2023b
  • VSCode: latest
  • matlab-language-server: 1.2.0
  • Windows10

yutaka-shoji avatar Mar 21 '24 14:03 yutaka-shoji

Thanks for reporting this!

Can you share the log files?

dklilley avatar Mar 21 '24 14:03 dklilley

With neovim lsp usage, the log is same

yutaka-shoji avatar Mar 21 '24 14:03 yutaka-shoji

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

yutaka-shoji avatar Mar 22 '24 03:03 yutaka-shoji

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?

dklilley avatar Apr 04 '24 17:04 dklilley

@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

yutaka-shoji avatar Apr 05 '24 05:04 yutaka-shoji

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

dklilley avatar Apr 10 '24 15:04 dklilley

@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.

yutaka-shoji avatar Apr 11 '24 15:04 yutaka-shoji

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

YiZhiRikka avatar May 12 '24 09:05 YiZhiRikka