From 90f84e7e755f72bb99dc8a9dedbfef05e58eb09d Mon Sep 17 00:00:00 2001 From: Stanislav Zeman Date: Mon, 20 Oct 2025 11:27:52 +0200 Subject: [PATCH] feat(extras): add Dart language (#4749) ## Description This PR add Dart language support to **extras** section. ## Testing I checked that: - the LSP correctly loads on Dart files and provides suggestions and highlights errors - `treesitter` parses the Dart language tree and highlights the code - `conform` correctly formats Dart files using the built-in formatter - `neotest` is capable of running Dart tests ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/dart.lua | 45 ++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/dart.lua diff --git a/lua/lazyvim/plugins/extras/lang/dart.lua b/lua/lazyvim/plugins/extras/lang/dart.lua new file mode 100644 index 00000000..1a27ae33 --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/dart.lua @@ -0,0 +1,45 @@ +return { + recommended = function() + return LazyVim.extras.wants({ + ft = "dart", + root = { "pubspec.yaml" }, + }) + end, + { + "neovim/nvim-lspconfig", + opts = { + servers = { + dartls = {}, + }, + }, + }, + { + "nvim-treesitter/nvim-treesitter", + opts = { ensure_installed = { "dart" } }, + }, + { + "stevearc/conform.nvim", + opts = { + formatters = { + dart_format = { + args = { "format", "--line-length", "120" }, + }, + }, + formatters_by_ft = { + dart = { "dart_format" }, + }, + }, + }, + { + "nvim-neotest/neotest", + optional = true, + dependencies = { + "sidlatau/neotest-dart", + }, + opts = { + adapters = { + ["neotest-dart"] = {}, + }, + }, + }, +}