Skip to content

matlab_ls connection times out from neovim and possibly vscode #76

@nickcounts

Description

@nickcounts

neovim lsp detects Matlab project, starts ls, fails to establish connection. :LspInfo shows matlab_ls as active client, version (no serverInfo.version response).

As far as I can tell, nvim is able to launch matlab-language-server, there is socket connectivity as demonstrated by curl from :terminal inside neovim. Running matlab-language-server --stdio from :terminal produces a reasonable looking response.

Attempted to use --sockets with the socket found from lsof. When I do that, the :LspLog line shows a MASSIVE line that appears to be some kind of minified javascript. The source is matlab-language-server/out/index.js and the line terminates mid-statement. It looks incomplete, so I opened the index.js file to see if it was malformed and found TONS of crazy looking things in the file, tons of Chinese characters, a bajillion (scientific term) random looking URLs, and so much more. It looks like roughly 2 megs of text.

It's possible that my log is simply breaking, and that the entire well-formed js string is being passed, but I can't tell. It's obviously too big to paste here. I poked through the language server repository and my local copy and I can't figure out where that could possibly be coming from. There must be some dependency that is generating it. Hopefully that's not important, but I thought it was odd enough to mention.

I'm really at a loss. I can launch matlab-language-server from vim terminal, I can curl it and get a good response. The connection just appears to be timing out. I am using the old desktop. Really can't think of what else to do, but I'm /dying/ without the language server. I can't handle the Matlab editor without my vim bindings - I keep typing :w and long strings of jjjjjjjjj all over the place.

:LspInfo shows

vim.lsp: Active Clients ~
- matlab_ls (id: 1)
  - Version: ? (no serverInfo.version response)
  - Root directory:
      ~/Documents/MATLAB/MDRT
  - Command: { "matlab-language-server", "--stdio" }
  - Settings: {
      MATLAB = {
        indexWorkspace = false,
        installPath = "/Applications/MATLAB_R2024a.app",
        matlabConnectionTiming = "onStart",
        prewarmGraphics = false,
        telemetry = false
      }
    }
  - Attached buffers: 21

:LspLog shows

[START][2026-01-19 21:04:08] LSP logging initiated
[ERROR][2026-01-19 21:04:08] .../nvim-macos-arm64/share/nvim/runtime/lua/vim/lsp/log.lua:151	"rpc"	"matlab-language-server"	"stderr"	"(node:38664) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.\n(Use `node --trace-deprecation ...` to show where the warning was created)\n"
[WARN][2026-01-19 21:04:08] .../nvim-macos-arm64/share/nvim/runtime/lua/vim/lsp/log.lua:151	"The language server matlab_ls triggers a registerCapability handler for workspace/didChangeConfiguration despite dynamicRegistration set to false. Report upstream, this warning is harmless"
[WARN][2026-01-19 21:04:08] .../nvim-macos-arm64/share/nvim/runtime/lua/vim/lsp/log.lua:151	"The language server matlab_ls triggers a registerCapability handler for workspace/didChangeWorkspaceFolders despite dynamicRegistration set to false. Report upstream, this warning is harmless"
[ERROR][2026-01-19 21:04:12] .../nvim-macos-arm64/share/nvim/runtime/lua/vim/lsp/log.lua:151	"rpc"	"matlab-language-server"	"stderr"	"(node:38664) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.\n"
[ERROR][2026-01-19 21:04:15] .../nvim-macos-arm64/share/nvim/runtime/lua/vim/lsp/log.lua:151	"(21:04:15) matlabls - ERROR: Timeout when attaching to release: 24a"
> lsof -i -P -n | grep -i matlab
MATLAB    38667 nick  639u  IPv4 0xbcfa5d52e3368be1      0t0    TCP 127.0.0.1:31515 (LISTEN)
MATLAB    38667 nick  647u  IPv4 0x8675f70308af4699      0t0    TCP 10.0.1.129:62427->23.3.132.61:443 (ESTABLISHED)
MATLAB    38667 nick  649u  IPv4 0xb705cb57e1d56745      0t0    TCP 127.0.0.1:31515->127.0.0.1:62428 (ESTABLISHED)
> curl -k -v https://127.0.0.1:31515
*   Trying 127.0.0.1:31515...
* Connected to 127.0.0.1 (127.0.0.1) port 31515
* ALPN: curl offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Certificate (11):
* (304) (IN), TLS handshake, CERT verify (15):
* (304) (IN), TLS handshake, Finished (20):
* (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-AES256-GCM-SHA384 / [blank] / UNDEF
* ALPN: server did not agree on a protocol. Uses default.
* Server certificate:
*  subject: C=US; O=company; CN=127.0.0.1; OU=engineering
*  start date: Sep  8 19:37:55 2025 GMT
*  expire date: Sep  8 19:37:55 2026 GMT
*  issuer: C=US; O=company; CN=127.0.0.1; OU=engineering
*  SSL certificate verify result: self signed certificate (18), continuing anyway.
* using HTTP/1.x
> GET / HTTP/1.1
> Host: 127.0.0.1:31515
> User-Agent: curl/8.7.1
> Accept: */*
> 
* Request completely sent off
< HTTP/1.1 200 OK
< Date: Tue, 20 Jan 2026 02:05:51 GMT
< Connection: Keep-Alive
< Pragma: no-cache
< Content-Security-Policy: default-src 'self' *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https://localhost:* https:
//127.0.0.1:*; style-src 'self' 'unsafe-inline' *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https://localhost:* http
s://127.0.0.1:*; script-src 'self' 'unsafe-inline' 'unsafe-eval' *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https:/
/localhost:* https://127.0.0.1:*; img-src 'self' blob *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https://localhost:
* https://127.0.0.1:* data:; font-src 'self' *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https://localhost:* https:/
/127.0.0.1:* data:; frame-ancestors 'self' *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https://localhost:* https://1
27.0.0.1:*; frame-src 'self' https://www.getfeedback.com *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https://localho
st:* https://127.0.0.1:*; connect-src 'self' blob: *.mathworks.com:* *.thingspeak.com:* thingspeak.com:* *.matlab.com:* https://localhost:* h
ttps://127.0.0.1:* wss://localhost:* wss://127.0.0.1:*
< Strict-Transport-Security: max-age=31536000; includeSubDomains
< X-XSS-Protection: 1; mode=block
< Expires: Wed, 21 Oct 2015 07:28:00 GMT
< Referrer-Policy: strict-origin
< Content-Length: 211
< X-Content-Type-Options: nosniff
< ETag: "1459445420211"
< Last-Modified: Thu, 31 Mar 2016 17:30:20 GMT
< Content-Type: text/html
< Accept-Ranges: bytes
< Cache-Control: no-cache, no-store, must-revalidate
< X-Frame-Options: sameorigin
< Set-Cookie: JSESSIONID2=NsEB6LqS8aPtNZS7; Path=/; HttpOnly; Secure; SameSite=None
< 
<!doctype html>
<html>
<head>
    <title>connector service</title>
        <link href="/css/connector.css" rel="stylesheet" type="text/css" />
</head>
<body>
        <h1>The connector service is running.</h1>
</body>
</html>
* Connection #0 to host 127.0.0.1 left intact

To Reproduce

  1. open neovim in a Matlab project folder (root of git repository)
  2. open a .m file
  3. :LspInfo shows server attached to buffer but no serverInfo.version
  4. try to use LSP features, they don't work
  5. check :LspLog and see connection timeout errors

Expected behavior
I expect the language server to connect and for :LspInfo to show a server version. I expect the basic language server functions to work. I understand that hover is not currently supported, but there is no completion suggestion and

Useful Information

  • MATLAB Version: R2024a (24.1.0.2537033) 64-bit (maca64)
  • Operating System: MacOS 26.2 on M2 Pro
  • Editor: vim v0.12.0-dev
  • matlab-language-server v1.3.8 #92c424b
  • node 25.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions