julia.lua 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. local M = {}
  2. M.config = function()
  3. O.lang.julia = {}
  4. end
  5. M.format = function()
  6. -- todo: implement formatters (if applicable)
  7. return "no formatters configured!"
  8. end
  9. M.lint = function()
  10. -- todo: implement linters (if applicable)
  11. return "no linters configured!"
  12. end
  13. M.lsp = function()
  14. if require("lv-utils").check_lsp_client_active "julials" then
  15. return
  16. end
  17. -- Add the following lines to a new julia file, e.g. install.jl
  18. -- using Pkg
  19. -- Pkg.instantiate()
  20. -- Run the file you created.
  21. -- julia install.jl
  22. -- Julia language server will now be installed on your system.
  23. local cmd = {
  24. "julia",
  25. "--startup-file=no",
  26. "--history-file=no",
  27. -- vim.fn.expand "~/.config/nvim/lua/lsp/julia/run.jl",
  28. CONFIG_PATH .. "/lua/lsp/julia/run.jl",
  29. }
  30. require("lspconfig").julials.setup {
  31. cmd = cmd,
  32. on_new_config = function(new_config, _)
  33. new_config.cmd = cmd
  34. end,
  35. filetypes = { "julia" },
  36. }
  37. end
  38. M.dap = function()
  39. -- TODO: implement dap
  40. return "No DAP configured!"
  41. end
  42. return M