julia.lua 1.1 KB

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