-
-
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.
- Loading branch information
Showing
14 changed files
with
360 additions
and
213 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
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
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
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,5 @@ | ||
# Sniprun | ||
|
||
**Repository**: <https://github.com/michaelb/sniprun> | ||
|
||
Sniprun is a code runner plugin for neovim written in Lua and Rust. It aims to provide stupidly fast partial code testing for interpreted and compiled languages. Sniprun blurs the line between standard save/run workflow, jupyter-like notebook, and REPL/interpreters. |
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,9 @@ | ||
return { | ||
{ | ||
"michaelb/sniprun", | ||
keys = {}, | ||
opts = {}, | ||
build = "bash ./install.sh 1", | ||
cmd = "SnipRun", | ||
}, | ||
} |
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
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 }, | ||
} |
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 |
---|---|---|
@@ -1,47 +1 @@ | ||
local utils = require "astrocommunity.utils" | ||
|
||
return { | ||
{ import = "astrocommunity.pack.json" }, | ||
{ | ||
"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, { "javascript", "typescript", "tsx" }) | ||
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, "denols") | ||
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, | ||
}, | ||
{ | ||
"sigmasd/deno-nvim", | ||
init = function() utils.list_insert_unique(astronvim.lsp.skip_setup, "denols") end, | ||
ft = { | ||
"typescript", | ||
"typescriptreact", | ||
"javascript", | ||
"javascriptreact", | ||
}, | ||
opts = function() return { server = require("astronvim.utils.lsp").config "denols" } end, | ||
}, | ||
} | ||
return require("astrocommunity.pack.typescript-tsserver-and-denols.denols").get_config() |
59 changes: 59 additions & 0 deletions
59
lua/astrocommunity/pack/typescript-tsserver-and-denols/denols.lua
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,59 @@ | ||
local utils = require "astrocommunity.utils" | ||
local ts_config = require "astrocommunity.pack.typescript-tsserver-and-denols.ts-config" | ||
|
||
local Deno = { | ||
dap_config = { | ||
{ | ||
request = "launch", | ||
name = "(Deno) Launch current file", | ||
type = "pwa-node", | ||
program = "${file}", | ||
cwd = vim.fn.getcwd(), | ||
runtimeExecutable = "deno", | ||
runtimeArgs = { "run", "--inspect-wait", "--allow-all" }, | ||
attachSimplePort = 9229, | ||
}, | ||
{ | ||
request = "launch", | ||
name = "(Deno) Launch main.ts", | ||
type = "pwa-node", | ||
program = "${workspaceFolder}/main.ts", | ||
cwd = vim.fn.getcwd(), | ||
runtimeExecutable = "deno", | ||
runtimeArgs = { "run", "--inspect-wait", "--allow-all" }, | ||
attachSimplePort = 9229, | ||
}, | ||
}, | ||
} | ||
|
||
function Deno.get_base_config() | ||
local base_config = ts_config.get_base_config "denols" | ||
|
||
table.insert(base_config, { | ||
"sigmasd/deno-nvim", | ||
init = function() utils.list_insert_unique(astronvim.lsp.skip_setup, "denols") end, | ||
ft = ts_config.filetypes, | ||
opts = function() return { server = require("astronvim.utils.lsp").config "denols" } end, | ||
}) | ||
return base_config | ||
end | ||
|
||
function Deno.get_dap_config() | ||
local base_dap_config = ts_config.get_base_dap_config | ||
|
||
base_dap_config.config = function() | ||
local dap = require "dap" | ||
for _, language in ts_config.filetypes do | ||
dap.configurations[language] = Deno.dap_config | ||
end | ||
end | ||
return base_dap_config | ||
end | ||
|
||
function Deno.get_config() | ||
local base_config = Deno.get_base_config() | ||
table.insert(base_config, Deno.get_dap_config()) | ||
return base_config | ||
end | ||
|
||
return Deno |
60 changes: 60 additions & 0 deletions
60
lua/astrocommunity/pack/typescript-tsserver-and-denols/ts-config.lua
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,60 @@ | ||
local utils = require "astrocommunity.utils" | ||
|
||
local filetypes = { "javascript", "typescript", "javascriptreact", "typescriptreact" } | ||
|
||
local M = { | ||
filetypes = filetypes, | ||
get_base_dap_config = { | ||
"mfussenegger/nvim-dap", | ||
ft = filetypes, | ||
enabled = true, | ||
dependencies = { | ||
{ | ||
"mxsdev/nvim-dap-vscode-js", | ||
opts = { debugger_cmd = { "js-debug-adapter" }, adapters = { "pwa-node" } }, | ||
}, | ||
{ "theHamsta/nvim-dap-virtual-text", config = true }, | ||
{ "rcarriga/nvim-dap-ui", config = true }, | ||
}, | ||
}, | ||
} | ||
|
||
function M.get_base_config(lsp) | ||
if lsp ~= "tsserver" and lsp ~= "denols" then error("Invalid lsp: " .. lsp) end | ||
return { | ||
{ import = "astrocommunity.pack.json" }, | ||
{ | ||
"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, { "javascript", "typescript", "tsx" }) | ||
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, lsp) | ||
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, | ||
}, | ||
} | ||
end | ||
|
||
return M |
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
Oops, something went wrong.