summaryrefslogtreecommitdiff
path: root/lua/lang/julia.lua
blob: a1c0241dbd1b593ba583ad922535b5de26a694fe (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
local M = {}

M.config = function()
  O.lang.julia = {
    lsp = {
      path = CONFIG_PATH .. "/lua/lsp/julia/run.jl",
    },
  }
end

M.format = function()
  -- todo: implement formatters (if applicable)
  return "no formatters configured!"
end

M.lint = function()
  -- todo: implement linters (if applicable)
  return "no linters configured!"
end

M.lsp = function()
  if require("lv-utils").check_lsp_client_active "julials" then
    return
  end
  -- Add the following lines to a new julia file, e.g. install.jl
  -- using Pkg
  -- Pkg.instantiate()
  -- Run the file you created.
  -- julia install.jl
  -- Julia language server will now be installed on your system.

  local cmd = {
    "julia",
    "--startup-file=no",
    "--history-file=no",
    -- vim.fn.expand "~/.config/nvim/lua/lsp/julia/run.jl",
    O.lang.julia.lsp.path,
  }
  require("lspconfig").julials.setup {
    cmd = cmd,
    on_new_config = function(new_config, _)
      new_config.cmd = cmd
    end,
    filetypes = { "julia" },
  }
end

M.dap = function()
  -- TODO: implement dap
  return "No DAP configured!"
end

return M