Skip to content

Commit

Permalink
feat(pack): add dart (#136)
Browse files Browse the repository at this point in the history
- Adds `dart` ands `yaml` treesitter parsers
- Adds `dartls` language server
- Adds `flutter-tools.nvim` for language specific tooling
  • Loading branch information
alepop authored Apr 10, 2023
1 parent 5d909fa commit 45f6a45
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lua/astrocommunity/pack/dart/README.md
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)
41 changes: 41 additions & 0 deletions lua/astrocommunity/pack/dart/dart.lua
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 },
}

0 comments on commit 45f6a45

Please sign in to comment.