cs.lua 793 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. local M = {}
  2. M.config = function()
  3. O.lang.csharp = {
  4. lsp = {
  5. path = DATA_PATH .. "/lspinstall/csharp/omnisharp/run",
  6. },
  7. }
  8. end
  9. M.format = function()
  10. -- TODO: implement formatter for language
  11. return "No formatter available!"
  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 "omnisharp" then
  19. return
  20. end
  21. -- C# language server (csharp/OmniSharp) setup
  22. require("lspconfig").omnisharp.setup {
  23. on_attach = require("lsp").common_on_attach,
  24. cmd = { O.lang.csharp.lsp.path, "--languageserver", "--hostPID", tostring(vim.fn.getpid()) },
  25. }
  26. end
  27. M.dap = function()
  28. -- TODO: implement dap
  29. return "No DAP configured!"
  30. end
  31. return M