Skip to content

Commit

Permalink
feat(sql): add sqls.nvim plugin for sqls LSP extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed Apr 16, 2024
1 parent f70a57d commit 91e6578
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lua/astrocommunity/pack/sql/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# SQL Language Pack

This plugin pack does the following:

- Adds `sql` Treesitter parser
- Adds `sqls` language server
- Adds `sqlfluff` formatter
- Adds [sqls.nvim](https://github.com/nanotee/sqls.nvim) for language specific tooling
21 changes: 21 additions & 0 deletions lua/astrocommunity/pack/sql/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,25 @@ return {
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "sqlfluff", "sqls" })
end,
},
{
"nanotee/sqls.nvim",
lazy = true,
dependencies = {
"AstroNvim/astrocore",
opts = {
autocmds = {
sqls_attach = {
{
event = "LspAttach",
desc = "Load sqls.nvim with sqls",
callback = function(args)
local client = assert(vim.lsp.get_client_by_id(args.data.client_id))
if client.name == "sqls" then require("sqls").on_attach(client, args.buf) end
end,
},
},
},
},
},
},
}

0 comments on commit 91e6578

Please sign in to comment.