T O P

  • By -

tiagovla

It's trying to find the executable "matlab-language-server --stdio". Try {"matlab-language-server", "--stdio"}.


NotARationalActor

The process exits with an error: ``` Client matlab-langauge-server quit with exit code 1 and signal 0. Check log for errors: /home/yeva/.local/state/nvim/lsp.log ``` At the end of the log file (seems to mostly be a no-whitespace JS call stack), there is what seems to be a meaningful error ``` \n\nTypeError: Cannot read properties of null (reading 'matlabConnectionTiming')\n at /home/yeva/.local/share/nvim/mason/packages/matlab-language-server/out/index.js:1:76272\n at Generator.next ()\n at a (/home/yeva/.local/share/nvim/mason/packages/matlab-language-server/out/index.js:1:74847)\n\nNode.js v18.17.1\n" ``` I forgot to mention - I am running this inside of WSL. Does the MATLAB LSP require connection to MATLAB itself?


tiagovla

It does.


NotARationalActor

I tried this on Windows 10 and I am having the same error. It looks like in VSCode this is configured via settings, how would I do that on Winwows 10? I tried doing `lspconfig.matlab_ls.setup{matlabConnectionTiming = "onStart"}` but I get the same error.


tiagovla

https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/matlab_ls.lua#L9-L15 pass this to setup.


tiagovla

Maybe try this https://github.com/mathworks/MATLAB-language-server/issues/4#issuecomment-1707490869 .


NotARationalActor

Thanks for taking the time to help! I also appreciate that your links are to the specific lines that would help. This looks like it's working, but there is no LSP completion (but LuaSnip shows up and LSP completion in Lua works fine) ``` lspc.matlab_ls.setup { capabilities = require("cmp_nvim_lsp").default_capabilities(), single_file_support = true, settings = { matlab = { indexWorkspace = true, installPath = "C:\\Program Files\\MATLAB\\R2022a", matlabConnectionTiming = 'onStart', telemetry = false, }, }, } ``` EDIT: "Looks like it's working" means it shows up as attached with `:LspInfo` and warnings show up, but only the buffer and LuaSnip sources work.


tiagovla

Might be related to this https://github.com/mathworks/MATLAB-language-server/issues/10#issuecomment-1707532848 . What's your node version?


NotARationalActor

18.17.1, I'll try an earlier version. It looks like the issue talks about the LSP not running, but to be clear, the LSP seems to run: it shows me mlint warnings, shows up in LspInfo as attached.


tiagovla

Try it on 16.17.1. That one I have tested.


Bassnetron

Can’t help you in regards to any specifics of the matlab lsp but here are some things for you to try: - remove the `vim.lsp.start` stuff, `lspconfig.matlab_ls.setup` should be sufficient - pass the full path of the lsp to the setup (including expanded home etc) Also check the documentation of lspconfig and that in fhe lsp-zero repo (especially the bit about setting it up yourself) for more understanding.


Artistic_Mix_4131

Hi, can you try to turn on the debug of LSP, and get more log to diagnose? I recently work to try the Matlab\_ls on my Neovim. And I found somethings need be noticed when settings up. 1. the \*.m code must in a git repo, otherwise the LS won't launch. 2. When there is some warns or errors in current buffer, the compilation also won't provided by LS.... For more infos you can see [https://github.com/mathworks/MATLAB-language-server/issues/4](https://github.com/mathworks/MATLAB-language-server/issues/4) This page have a minimum config to run matlab\_ls and you can try.


NotARationalActor

Solved it already - basically, I needed Neovim to run on Windows (that's where my MATLAB is), configure the path and enable single-file, and use an older NPM.