switch back to luafmt
This commit is contained in:
@@ -82,10 +82,17 @@ function check_binary() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export PATH="${HOME}/.local/bin:${PATH}"
|
||||||
|
|
||||||
for BINARY in "${NVIM_REQUIRED_BINARIES[@]}"; do
|
for BINARY in "${NVIM_REQUIRED_BINARIES[@]}"; do
|
||||||
check_binary "$BINARY"
|
check_binary "$BINARY"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if ! command -v luafmt >/dev/null 2>&1; then
|
||||||
|
npm install --global --prefix "${HOME}/.local" lua-fmt
|
||||||
|
fi
|
||||||
|
check_binary luafmt
|
||||||
|
|
||||||
pushd "${SCRIPT_DIR}" 1>/dev/null 2>&1 || error_exit "failed to push: ${SCRIPT_DIR}"
|
pushd "${SCRIPT_DIR}" 1>/dev/null 2>&1 || error_exit "failed to push: ${SCRIPT_DIR}"
|
||||||
FNAME=cpptools-${NVIM_OS}-${NVIM_ARCH2}.vsix
|
FNAME=cpptools-${NVIM_OS}-${NVIM_ARCH2}.vsix
|
||||||
if [ ! -f "dap/${FNAME}" ]; then
|
if [ ! -f "dap/${FNAME}" ]; then
|
||||||
|
|||||||
@@ -177,7 +177,6 @@ NV_DARCULA_MASON_TOOL_LIST =
|
|||||||
"clang-format",
|
"clang-format",
|
||||||
"gofumpt",
|
"gofumpt",
|
||||||
"google-java-format",
|
"google-java-format",
|
||||||
"luaformatter",
|
|
||||||
"prettier",
|
"prettier",
|
||||||
"shellcheck",
|
"shellcheck",
|
||||||
"shfmt",
|
"shfmt",
|
||||||
|
|||||||
@@ -46,8 +46,7 @@ vim.diagnostic.config(
|
|||||||
[vim.diagnostic.severity.HINT] = "DiagnosticLineNrHint"
|
[vim.diagnostic.severity.HINT] = "DiagnosticLineNrHint"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
virtual_text =
|
virtual_text = utils.iff(
|
||||||
utils.iff(
|
|
||||||
NV_DARCULA_ENABLE_VIRTUAL_TEXT,
|
NV_DARCULA_ENABLE_VIRTUAL_TEXT,
|
||||||
{prefix = symbols.line.info .. " "},
|
{prefix = symbols.line.info .. " "},
|
||||||
false
|
false
|
||||||
|
|||||||
@@ -19,27 +19,6 @@
|
|||||||
--
|
--
|
||||||
local formatter_util = require("formatter.util")
|
local formatter_util = require("formatter.util")
|
||||||
|
|
||||||
local lua_format_executable = function()
|
|
||||||
local executable = vim.fn.exepath("lua-format")
|
|
||||||
if executable ~= "" then
|
|
||||||
return executable
|
|
||||||
end
|
|
||||||
|
|
||||||
local native_executable =
|
|
||||||
vim.fs.joinpath(
|
|
||||||
vim.fs.dirname(vim.fn.stdpath("data")),
|
|
||||||
"nvim2",
|
|
||||||
"mason",
|
|
||||||
"bin",
|
|
||||||
"lua-format"
|
|
||||||
)
|
|
||||||
if vim.fn.executable(native_executable) ~= 0 then
|
|
||||||
return native_executable
|
|
||||||
end
|
|
||||||
|
|
||||||
return "lua-format"
|
|
||||||
end
|
|
||||||
|
|
||||||
require("formatter").setup {
|
require("formatter").setup {
|
||||||
logging = true,
|
logging = true,
|
||||||
log_level = vim.log.levels.WARN,
|
log_level = vim.log.levels.WARN,
|
||||||
@@ -66,15 +45,16 @@ require("formatter").setup {
|
|||||||
javascriptreact = {require("formatter.filetypes.javascriptreact").prettier},
|
javascriptreact = {require("formatter.filetypes.javascriptreact").prettier},
|
||||||
json = {require("formatter.filetypes.json").prettier},
|
json = {require("formatter.filetypes.json").prettier},
|
||||||
lua = {
|
lua = {
|
||||||
|
require("formatter.filetypes.lua").luafmt,
|
||||||
function()
|
function()
|
||||||
return {
|
return {
|
||||||
exe = lua_format_executable(),
|
exe = "luafmt",
|
||||||
args = {
|
args = {
|
||||||
"--column-limit=80",
|
"--stdin",
|
||||||
"--indent-width=2",
|
"-l",
|
||||||
formatter_util.escape_path(
|
"80",
|
||||||
formatter_util.get_current_buffer_file_path()
|
"-i",
|
||||||
)
|
"2"
|
||||||
},
|
},
|
||||||
stdin = true
|
stdin = true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user