mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-22 12:31:07 +00:00
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.
This commit is contained in:
parent
f4b08bb604
commit
90f84e7e75
1 changed files with 45 additions and 0 deletions
45
lua/lazyvim/plugins/extras/lang/dart.lua
Normal file
45
lua/lazyvim/plugins/extras/lang/dart.lua
Normal file
|
|
@ -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"] = {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue