Skip to content

Commit

Permalink
feat(pack): add svelte language pack
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter authored and luxus committed Mar 10, 2023
1 parent 74473d8 commit 9748fd5
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lua/astrocommunity/pack/svelte/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Svelte Language Pack

This plugin pack does the following:

- Adds `svelte` Treesitter parsers
- Adds `svelte` language server
- Adds `js-debug-adapter` for debugging
- Adds [nvim-dap-vscode-js](https://github.com/mxsdev/nvim-dap-vscode-js) for debugging
34 changes: 34 additions & 0 deletions lua/astrocommunity/pack/svelte/svelte.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
local utils = require "astrocommunity.utils"
return {
{
"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 required file types to opts.ensure_installed.
utils.list_insert_unique(opts.ensure_installed, "svelte")
end,
},
{
"williamboman/mason-lspconfig.nvim",
opts = function(_, opts)
-- Ensure that opts.ensure_installed exists and is a table.
if not opts.ensure_installed then opts.ensure_installed = {} end
-- Add tsserver to opts.ensure_installed using vim.list_extend.
utils.list_insert_unique(opts.ensure_installed, "svelte")
end,
},
{
"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
-- Add to opts.ensure_installed using table.insert.
utils.list_insert_unique(opts.ensure_installed, "js")
end,
},
}

0 comments on commit 9748fd5

Please sign in to comment.