-
-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Adds `dart` ands `yaml` treesitter parsers - Adds `dartls` language server - Adds `flutter-tools.nvim` for language specific tooling
- Loading branch information
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Dart Language Pack | ||
|
||
This plugin pack does the following: | ||
|
||
- Adds `dart` Treesitter parsers | ||
- Adds `dartls` language server | ||
- Adds [flutter-tools.nvim](https://github.com/akinsho/flutter-tools.nvim) for language specific tooling | ||
- Adds [YAML language support](../yaml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
local utils = require "astrocommunity.utils" | ||
return { | ||
{ import = "astrocommunity.pack.yaml" }, | ||
{ | ||
"nvim-treesitter/nvim-treesitter", | ||
opts = function(_, opts) | ||
-- Ensure that opts.ensure_installed exists and is a table or string "all". | ||
if not opts.ensure_installed then | ||
opts.ensure_installed = {} | ||
elseif opts.ensure_installed == "all" then | ||
return | ||
end | ||
-- Add the "dart" and "yaml" language to opts.ensure_installed. | ||
utils.list_insert_unique(opts.ensure_installed, "dart") | ||
end, | ||
}, | ||
{ | ||
"akinsho/flutter-tools.nvim", | ||
ft = { "dart" }, | ||
init = function() utils.list_insert_unique(astronvim.lsp.skip_setup, "dartls") end, | ||
opts = { | ||
lsp = require("astronvim.utils.lsp").config "dartls", | ||
debugger = { | ||
enabled = true, | ||
}, | ||
}, | ||
dependencies = { | ||
{ "nvim-lua/plenary.nvim" }, | ||
{ | ||
"jay-babu/mason-nvim-dap.nvim", | ||
opts = function(_, opts) | ||
-- Ensure that opts.ensure_installed exists and is a table. | ||
if not opts.ensure_installed then opts.ensure_installed = {} end | ||
utils.list_insert_unique(opts.ensure_installed, "dart") | ||
end, | ||
}, | ||
}, | ||
}, | ||
-- Add "flutter" extension to "telescope" | ||
{ "nvim-telescope/telescope.nvim", opts = function() require("telescope").load_extension "flutter" end }, | ||
} |