fixed lua formatting and added kiro-cli install
This commit is contained in:
@@ -248,6 +248,9 @@ ENV \
|
|||||||
UID="1000" \
|
UID="1000" \
|
||||||
UNAME="neovim"
|
UNAME="neovim"
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
curl -fsSL https://cli.kiro.dev/install | bash
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
cd "/home/${UNAME}" && \
|
cd "/home/${UNAME}" && \
|
||||||
git clone https://github.com/flutter/flutter.git -b stable flutter && \
|
git clone https://github.com/flutter/flutter.git -b stable flutter && \
|
||||||
|
|||||||
@@ -119,6 +119,11 @@ if [ ! -d "${HOME}/.local/share/${NVIM_APPNAME}/Dart-Code" ]; then
|
|||||||
popd 1>/dev/null 2>&1 || error_exit "failed to popd: Dart-Code"
|
popd 1>/dev/null 2>&1 || error_exit "failed to popd: Dart-Code"
|
||||||
popd 1>/dev/null 2>&1 || error_exit "failed to popd: ${HOME}/.local/share/${NVIM_APPNAME}"
|
popd 1>/dev/null 2>&1 || error_exit "failed to popd: ${HOME}/.local/share/${NVIM_APPNAME}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "${HOME}/.local/bin/kiro-cli" ]; then
|
||||||
|
curl -fsSL https://cli.kiro.dev/install | bash
|
||||||
|
fi
|
||||||
|
|
||||||
popd 1>/dev/null 2>&1 || error_exit "failed to popd: ${SCRIPT_DIR}"
|
popd 1>/dev/null 2>&1 || error_exit "failed to popd: ${SCRIPT_DIR}"
|
||||||
|
|
||||||
export NVIM_ARCH
|
export NVIM_ARCH
|
||||||
|
|||||||
@@ -177,6 +177,7 @@ 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,12 +46,9 @@ require("mason-tool-installer").setup {
|
|||||||
run_on_start = true
|
run_on_start = true
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.lsp.config(
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
"*",
|
|
||||||
{
|
vim.lsp.config("*", {capabilities = capabilities})
|
||||||
capabilities = require("cmp_nvim_lsp").default_capabilities()
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
for _, name in pairs(NV_DARCULA_MASON_LSP_LIST) do
|
for _, name in pairs(NV_DARCULA_MASON_LSP_LIST) do
|
||||||
if name == "clangd" then
|
if name == "clangd" then
|
||||||
@@ -64,6 +61,15 @@ for _, name in pairs(NV_DARCULA_MASON_LSP_LIST) do
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
elseif name == "cspell_ls" then
|
||||||
|
local cspell_capabilities = vim.deepcopy(capabilities)
|
||||||
|
cspell_capabilities.workspace = {
|
||||||
|
didChangeWatchedFiles = {
|
||||||
|
dynamicRegistration = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.lsp.config(name, {capabilities = cspell_capabilities})
|
||||||
elseif name == "lua_ls" then
|
elseif name == "lua_ls" then
|
||||||
vim.lsp.config(
|
vim.lsp.config(
|
||||||
name,
|
name,
|
||||||
|
|||||||
@@ -19,6 +19,27 @@
|
|||||||
--
|
--
|
||||||
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,
|
||||||
@@ -45,16 +66,15 @@ 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 = "luafmt",
|
exe = lua_format_executable(),
|
||||||
args = {
|
args = {
|
||||||
"--stdin",
|
"--column-limit=80",
|
||||||
"-l",
|
"--indent-width=2",
|
||||||
"80",
|
formatter_util.escape_path(
|
||||||
"-i",
|
formatter_util.get_current_buffer_file_path()
|
||||||
"2"
|
)
|
||||||
},
|
},
|
||||||
stdin = true
|
stdin = true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user