-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error launching MATLAB on Neovim #33
Comments
I am getting a similar error
I am using matlab version R2023a |
Can you try to open terminal inside of your nvim session (enter |
Thank you so much!!!! ' installPath = "/usr/local/MATLAB/R2023a",' Thank you! |
I can
I can successfully run I configured lsp directly with the following configuration
for matlab_ls is a bash shell
I tried to switch to the nvim-nightly version, but it still doesn't work and get
|
I have tried to reproduce your issue on my system (native Linux), but I couldn't. Could you start with a clean repo once again? This is what I'm doing to have this language server working:
|
I have try above and even clone a clean master source, but it still failed and get same error. |
I'm using the same node version and npm 10.2.4. Which Matlab version are you running? Currently, I'm on R2022b. |
I switched the npm version to 10.2.4 and tested matlab R2022b R2023b R2024a, and neovim-nightly version, but they all failed! |
Hello, I"m using neovim nightly v0.9.5 via WSL 2 on Arch Linux. I have gone through most of the issues above, but have been able to resolve most by installing Matlab locally in the Linux WSL. I can see from the logs that the server goes up, and it connects to it after I open a matlab file. The issue I have is that a few seconds later I get a message that the client quit: and the lsp.log file contains a very large output, but the top of the error there is [ERROR][2024-02-15 11:31:46] .../vim/lsp/rpc.lua:734 "rpc" "/home/rln/.local/share/nvim/mason/bin/matlab-language-server" "stderr" '),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}\ --- output truncated :LspInfo looks healthy enough for me I should add I tested Matlab R2021b and R2023b. Both have the same behavior. Any suggestions on how to do next to fix this? thanks! |
Proxy environment workaround
@Budali11 Thank you for your sharing.
#!/bin/bash
matlab="$HOME/.local/MATLAB/R2024a/bin/matlab"
$matlab "$@"
#!/bin/bash
exec /usr/bin/node "$HOME/github/MATLAB-language-server/out/index.js" "$@"
M.setup = function(on_attach, capabilities)
require("lspconfig").matlab_ls.setup {
on_attach = on_attach,
capabilities = capabilities,
cmd = { "matlab_ls", "--stdio" },
filetypes = { "matlab" },
-- root_dir = require("lspconfig.util").root_pattern "*.m",
root_dir = function(fname) return require("lspconfig.util").find_git_ancestor(fname) or vim.fn.getcwd() end,
settings = {
matlab = {
indexWorkspace = true,
matlabConnectionTiming = "onStart",
telemetry = true,
},
},
single_file_support = true,
handlers = {
["textDocument/publishDiagnostics"] = function() end, -- disable diagnostics, null_ls handles this
},
}
end |
@MiuKaShi It seems you're right and the |
Can you try launching the desired MATLAB normally, run the If these do match and still does not work, can you share the value? |
Hey @dklilley, I did as you asked and opened my R2024a installation, ran require('mason-lspconfig').setup({
ensure_installed = {
'rust_analyzer',
'clangd',
'pylsp',
'texlab',
'lua_ls',
'matlab_ls',
},
handlers = {
lsp.default_setup,
matlab_ls = function()
require('lspconfig').matlab_ls.setup({
capabilities = require('cmp_nvim_lsp').default_capabilities(),
settings = {
matlab = {
installPath = '/home/jlock/MATLAB/R2024a',
},
},
root_dir = function(fname)
return require('lspconfig.util').find_git_ancestor(fname)
end,
single_file_support = true,
})
end,
lua_ls = function()
require('lspconfig').lua_ls.setup({
settings = {
Lua = {
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { 'vim' }
}
}
}
})
end,
pylsp = function()
require('lspconfig').pylsp.setup({})
end
},
})
|
The installPath should work, but I'm not very familiar with the Neovim setup. @tiagovla , do you have any ideas on this? |
System: ArchLinux
Editor: nvim with matlab_ls
Matlab version: R2023b
Matlab-language-server version: 1.1.7
Problem:
fail to launch matlab
Works fine 2 months ago, but failed after updating Matlab-language-server
The text was updated successfully, but these errors were encountered: