Closed SubtleMuffin closed 11 months ago
Hmm two things does it work properly in neovim? Also the stuff under environment should be under config.matlab
I think
Thanks for the info! I can confirm that it works properly in neovim
. I cannot seem to find the documentation for config.<language>
. Could you please elaborate?
Quick background
MathWorks published their own MATLAB language server, and it is now working with
neovim
(vianvim-lspconfig
andmason
. In the discussions under issue 4, people can compile the language server and interact with it throughneovim
. I tried to do the same thing withHelix
, but failed. Here are my steps so far:Clone the MATLAB language server via
Compile the package via
Verify that it is working via
Make a short script
matlab_ls
as follows, mark it executable viachmod
, and store it somewhere on the$PATH
. Below, I am usingmason
installed version, but it should be the same.Helix
language settings, i.e.,<config_dir>/helix/languages.toml
[language-server.matlab_ls] command = "matlab_ls" args = ["--stdio"] config = { provideFormatter = true } environment = { "installPath" = "/usr/share/matlab", "indexWorkspace" = "true", "matlabConnectionTiming" = "onStart", "telemetry" = "false" }
2023-11-29T18:39:42.207 helix_vcs [INFO] file is untracked 2023-11-29T18:39:42.207 helix_vcs [INFO] failed to open diff base for /home/$USER/Documents/folder/test.m 2023-11-29T18:39:42.207 helix_lsp::client [INFO] Using custom LSP config: {"provideFormatter":true} 2023-11-29T18:39:42.207 helix_lsp::transport [INFO] matlab_ls -> {"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"general":{"positionEncodings":["utf-8","utf-32","utf-16"]},"textDocument":{"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dataSupport":true,"disabledSupport":true,"isPreferredSupport":true,"resolveSupport":{"properties":["edit","command"]}},"completion":{"completionItem":{"deprecatedSupport":true,"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"snippetSupport":true,"tagSupport":{"valueSet":[1]}},"completionItemKind":{}},"hover":{"contentFormat":["markdown"]},"inlayHint":{"dynamicRegistration":false},"publishDiagnostics":{"versionSupport":true},"rename":{"dynamicRegistration":false,"honorsChangeAnnotations":false,"prepareSupport":true},"signatureHelp":{"signatureInformation":{"activeParameterSupport":true,"documentationFormat":["markdown"],"parameterInformation":{"labelOffsetSupport":true}}}},"window":{"workDoneProgress":true},"workspace":{"applyEdit":true,"configuration":true,"didChangeConfiguration":{"dynamicRegistration":false},"didChangeWatchedFiles":{"dynamicRegistration":true,"relativePatternSupport":false},"executeCommand":{"dynamicRegistration":false},"inlayHint":{"refreshSupport":false},"symbol":{"dynamicRegistration":false},"workspaceEdit":{"documentChanges":true,"failureHandling":"abort","normalizesLineEndings":false,"resourceOperations":["create","rename","delete"]},"workspaceFolders":true}},"clientInfo":{"name":"helix","version":"23.10"},"initializationOptions":{"provideFormatter":true},"processId":33265,"rootPath":"/home/$USER/Documents/folder","rootUri":"file:///home/$USER/Documents/folder","workspaceFolders":[{"name":"folder","uri":"file:///home/$USER/Documents/folder"}]},"id":0} 2023-11-29T18:39:42.370 helix_lsp::transport [ERROR] matlab_ls err <- "(node:33293) [DEP0040] DeprecationWarning: The
2023-11-29T18:39:42.385 helix_lsp::transport [ERROR] matlab_ls err <- "Node.js v21.2.0\n"
2023-11-29T18:39:42.389 helix_lsp::transport [ERROR] matlab_ls err: <- StreamClosed
punycode
module is deprecated. Please use a userland alternative instead.\n" 2023-11-29T18:39:42.370 helix_lsp::transport [ERROR] matlab_ls err <- "(Usenode --trace-deprecation ...
to show where the warning was created)\n" 2023-11-29T18:39:42.372 helix_lsp::transport [INFO] matlab_ls <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":4,"message":"(18:39:42) matlabls: Log Directory: /tmp/matlabls_33293"}} 2023-11-29T18:39:42.372 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Log, message: "(18:39:42) matlabls: Log Directory: /tmp/matlabls_33293" } 2023-11-29T18:39:42.374 helix_lsp::transport [INFO] matlab_ls <- {"jsonrpc":"2.0","id":0,"result":{"capabilities":{"codeActionProvider":true,"completionProvider":{"triggerCharacters":[".","("," ",",","/","\"]},"definitionProvider":true,"documentFormattingProvider":true,"executeCommandProvider":{"commands":["matlabls.lint.suppress.line","matlabls.lint.suppress.file"]},"referencesProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"documentSymbolProvider":true,"textDocumentSync":2}}} 2023-11-29T18:39:42.374 helix_lsp::transport [INFO] matlab_ls <- {"capabilities":{"codeActionProvider":true,"completionProvider":{"triggerCharacters":[".","("," ",",","/","\"]},"definitionProvider":true,"documentFormattingProvider":true,"documentSymbolProvider":true,"executeCommandProvider":{"commands":["matlabls.lint.suppress.line","matlabls.lint.suppress.file"]},"referencesProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"textDocumentSync":2}} 2023-11-29T18:39:42.374 helix_lsp::transport [INFO] matlab_ls -> {"jsonrpc":"2.0","method":"initialized","params":{}} 2023-11-29T18:39:42.374 helix_lsp::transport [INFO] matlab_ls -> {"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{"provideFormatter":true}}} 2023-11-29T18:39:42.374 helix_lsp::transport [INFO] matlab_ls -> {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"matlab","text":"a = 3;\n","uri":"file:///home/$USER/Documents/folder/test.m","version":0}}} 2023-11-29T18:39:42.377 helix_lsp::transport [INFO] matlab_ls <- {"jsonrpc":"2.0","id":0,"method":"client/registerCapability","params":{"registrations":[{"id":"e64ea922-6bff-4ad7-93b8-c87065e27d40","method":"workspace/didChangeConfiguration","registerOptions":{}}]}} 2023-11-29T18:39:42.377 helix_term::application [WARN] Ignoring a client/registerCapability request because dynamic capability registration is not enabled. Please report this upstream to the language server 2023-11-29T18:39:42.377 helix_lsp::transport [INFO] matlab_ls -> {"jsonrpc":"2.0","result":null,"id":0} 2023-11-29T18:39:42.377 helix_lsp::transport [INFO] matlab_ls <- {"jsonrpc":"2.0","id":1,"method":"client/registerCapability","params":{"registrations":[{"id":"50e746db-07a7-490d-96c6-0f66a6dc6519","method":"workspace/didChangeWorkspaceFolders","registerOptions":{}}]}} 2023-11-29T18:39:42.377 helix_term::application [WARN] Ignoring a client/registerCapability request because dynamic capability registration is not enabled. Please report this upstream to the language server 2023-11-29T18:39:42.377 helix_lsp::transport [INFO] matlab_ls -> {"jsonrpc":"2.0","result":null,"id":1} 2023-11-29T18:39:42.378 helix_lsp::transport [INFO] matlab_ls <- {"jsonrpc":"2.0","id":2,"method":"workspace/configuration","params":{"items":[{"section":"MATLAB"}]}} 2023-11-29T18:39:42.378 helix_lsp::transport [INFO] matlab_ls -> {"jsonrpc":"2.0","result":[null],"id":2} 2023-11-29T18:39:42.378 helix_lsp::transport [INFO] matlab_ls <- {"jsonrpc":"2.0","id":3,"method":"workspace/configuration","params":{"items":[{"section":"MATLAB"}]}} 2023-11-29T18:39:42.378 helix_lsp::transport [INFO] matlab_ls -> {"jsonrpc":"2.0","result":[null],"id":3} 2023-11-29T18:39:42.379 helix_lsp::transport [INFO] matlab_ls <- {"jsonrpc":"2.0","method":"telemetry/logdata","params":{"eventKey":"ACTIONS","data":{"action_type":"openFile","result":"1"}}} 2023-11-29T18:39:42.379 helix_lsp::transport [INFO] matlab_ls <- {"jsonrpc":"2.0","id":4,"method":"workspace/configuration","params":{"items":[{"section":"MATLAB"}]}} 2023-11-29T18:39:42.379 helix_term::application [ERROR] received malformed notification from Language Server: Unhandled 2023-11-29T18:39:42.379 helix_lsp::transport [INFO] matlab_ls -> {"jsonrpc":"2.0","result":[null],"id":4} 2023-11-29T18:39:42.384 helix_lsp::transport [ERROR] matlab_ls err <- "/home/$USER/.local/share/nvim/mason/packages/matlab-language-server/out/index.js:1\n" 2023-11-29T18:39:42.384 helix_lsp::transport [ERROR] matlab_ls err <- ""(18:39:42) matlabls: Log Directory: /tmp/matlabls_33293