dart.lua 712 B

1234567891011121314151617181920212223242526272829
  1. O.formatters.filetype["dart"] = {
  2. function()
  3. return {
  4. exe = O.lang.dart.formatter.exe,
  5. args = O.lang.dart.formatter.args,
  6. stdin = not (O.lang.dart.formatter.stdin ~= nil),
  7. }
  8. end,
  9. }
  10. require("formatter.config").set_defaults {
  11. logging = false,
  12. filetype = O.formatters.filetype,
  13. }
  14. if require("lv-utils").check_lsp_client_active "dartls" then
  15. return
  16. end
  17. require("lspconfig").dartls.setup {
  18. cmd = { "dart", O.lang.dart.sdk_path, "--lsp" },
  19. on_attach = require("lsp").common_on_attach,
  20. init_options = {
  21. closingLabels = false,
  22. flutterOutline = false,
  23. onlyAnalyzeProjectsWithOpenFiles = false,
  24. outline = false,
  25. suggestFromUnimportedLibraries = true,
  26. },
  27. }