From f438dfff48f952521d1fc9c78ea269a10c27d02e Mon Sep 17 00:00:00 2001 From: Vu Le Thanh Date: Mon, 25 Jul 2022 22:47:39 +0700 Subject: feat: add sql-formatter (#140) --- lua/mason-registry/index.lua | 1 + lua/mason-registry/sql-formatter/init.lua | 11 +++++++++++ lua/mason-schemas/lsp/rescript-lsp.lua | 2 +- lua/mason/mappings/language.lua | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 lua/mason-registry/sql-formatter/init.lua (limited to 'lua') diff --git a/lua/mason-registry/index.lua b/lua/mason-registry/index.lua index ddfcbed9..93ec8d85 100644 --- a/lua/mason-registry/index.lua +++ b/lua/mason-registry/index.lua @@ -137,6 +137,7 @@ return { solidity = "mason-registry.solidity", sorbet = "mason-registry.sorbet", sourcery = "mason-registry.sourcery", + ["sql-formatter"] = "mason-registry.sql-formatter", sqlls = "mason-registry.sqlls", sqls = "mason-registry.sqls", staticcheck = "mason-registry.staticcheck", diff --git a/lua/mason-registry/sql-formatter/init.lua b/lua/mason-registry/sql-formatter/init.lua new file mode 100644 index 00000000..c3bcf10f --- /dev/null +++ b/lua/mason-registry/sql-formatter/init.lua @@ -0,0 +1,11 @@ +local Pkg = require "mason-core.package" +local npm = require "mason-core.managers.npm" + +return Pkg.new { + name = "sql-formatter", + desc = [[A whitespace formatter for different query languages]], + homepage = "https://sql-formatter-org.github.io/sql-formatter/", + languages = { Pkg.Lang.SQL }, + categories = { Pkg.Cat.Formatter }, + install = npm.packages { "sql-formatter", bin = { "sql-formatter" } }, +} diff --git a/lua/mason-schemas/lsp/rescript-lsp.lua b/lua/mason-schemas/lsp/rescript-lsp.lua index 3bc2fc22..1bd5dad7 100644 --- a/lua/mason-schemas/lsp/rescript-lsp.lua +++ b/lua/mason-schemas/lsp/rescript-lsp.lua @@ -1,3 +1,3 @@ -- THIS FILE IS GENERATED. DO NOT EDIT MANUALLY. -- stylua: ignore start -return {properties = {["rescript.settings.askToStartBuild"] = {default = true,description = "Whether you want the extension to prompt for autostarting a ReScript build if a project is opened with no build running.",scope = "language-overridable",type = "boolean"},["rescript.settings.autoRunCodeAnalysis"] = {default = false,description = "Automatically start ReScript's code analysis.",type = "boolean"},["rescript.settings.binaryPath"] = {default = vim.NIL,description = "Path to the directory where ReScript binaries are. You can use it if you haven't or don't want to use the installed ReScript from node_modules in your project.",type = { "string", "null" }},["rescript.settings.inlayHints.enable"] = {default = false,description = "Enable (experimental) inlay hints.",type = "boolean"},["rescript.settings.inlayHints.maxLength"] = {default = 25,markdownDescription = "Maximum length of character for inlay hints. Set to null to have an unlimited length. Inlay hints that exceed the maximum length will not be shown.",minimum = 0,type = { "null", "integer" }}},title = "ReScript",type = "object"} \ No newline at end of file +return {properties = {["rescript.settings.askToStartBuild"] = {default = true,description = "Whether you want the extension to prompt for autostarting a ReScript build if a project is opened with no build running.",scope = "language-overridable",type = "boolean"},["rescript.settings.autoRunCodeAnalysis"] = {default = false,description = "Automatically start ReScript's code analysis.",type = "boolean"},["rescript.settings.binaryPath"] = {default = vim.NIL,description = "Path to the directory where ReScript binaries are. You can use it if you haven't or don't want to use the installed ReScript from node_modules in your project.",type = { "string", "null" }},["rescript.settings.codeLens.enable"] = {default = false,description = "Enable (experimental) code lens for function definitions.",type = "boolean"},["rescript.settings.inlayHints.enable"] = {default = false,description = "Enable (experimental) inlay hints.",type = "boolean"},["rescript.settings.inlayHints.maxLength"] = {default = 25,markdownDescription = "Maximum length of character for inlay hints. Set to null to have an unlimited length. Inlay hints that exceed the maximum length will not be shown.",minimum = 0,type = { "null", "integer" }}},title = "ReScript",type = "object"} \ No newline at end of file diff --git a/lua/mason/mappings/language.lua b/lua/mason/mappings/language.lua index 14bde3b6..be57ee31 100644 --- a/lua/mason/mappings/language.lua +++ b/lua/mason/mappings/language.lua @@ -90,7 +90,7 @@ return { slint = { "slint-lsp" }, solidity = { "solang", "solidity" }, sphinx = { "esbonio" }, - sql = { "sqlls", "sqls" }, + sql = { "sql-formatter", "sqlls", "sqls" }, stylelint = { "stylelint-lsp" }, svelte = { "svelte-language-server" }, systemverilog = { "svlangserver", "svls", "verible" }, -- cgit v1.2.3-70-g09d2