Skip to content

Commit 90f84e7

Browse files
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.
1 parent f4b08bb commit 90f84e7

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
return {
2+
recommended = function()
3+
return LazyVim.extras.wants({
4+
ft = "dart",
5+
root = { "pubspec.yaml" },
6+
})
7+
end,
8+
{
9+
"neovim/nvim-lspconfig",
10+
opts = {
11+
servers = {
12+
dartls = {},
13+
},
14+
},
15+
},
16+
{
17+
"nvim-treesitter/nvim-treesitter",
18+
opts = { ensure_installed = { "dart" } },
19+
},
20+
{
21+
"stevearc/conform.nvim",
22+
opts = {
23+
formatters = {
24+
dart_format = {
25+
args = { "format", "--line-length", "120" },
26+
},
27+
},
28+
formatters_by_ft = {
29+
dart = { "dart_format" },
30+
},
31+
},
32+
},
33+
{
34+
"nvim-neotest/neotest",
35+
optional = true,
36+
dependencies = {
37+
"sidlatau/neotest-dart",
38+
},
39+
opts = {
40+
adapters = {
41+
["neotest-dart"] = {},
42+
},
43+
},
44+
},
45+
}

0 commit comments

Comments
 (0)