aboutsummaryrefslogtreecommitdiff
path: root/.config/nvim/lsp/matlab_ls.lua
blob: 6da14a0d89d4ee5b27d73b314d86c8463db03770 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---@brief
---
--- https://github.com/mathworks/MATLAB-language-server
---
--- MATLAB® language server implements the Microsoft® Language Server Protocol for the MATLAB language.
---
--- Make sure to set `MATLAB.installPath` to your MATLAB path, e.g.:
--- ```lua
--- settings = {
---   MATLAB = {
---     ...
---     installPath = '/usr/local/MATLAB/R2023a',
---     ...
---   },
--- },
--- ```

---@type vim.lsp.Config
return {
  cmd = { 'matlab-language-server', '--stdio' },
  filetypes = { 'matlab' },
  root_dir = function(bufnr, on_dir)
    local root_dir = vim.fs.root(bufnr, '.git')
    on_dir(root_dir or vim.fn.getcwd())
  end,
  settings = {
    MATLAB = {
      indexWorkspace = true,
      installPath = '', -- NOTE: Set this to your MATLAB installation path.
      matlabConnectionTiming = 'onStart',
      telemetry = true,
    },
  },
}