feat: consolidate Mason configuration and add new plugins for enhanced development workflow

- Refactor community.lua module structure for better readability

- Remove obsolete Mason configuration file

- Add new plugins: nvim-lsp-file-operations, nvim-vtsls, package-info.nvim, tsc.nvim

- Implement dynamic Mason package installation based on FRAMEWORK environment variable

- Create custom command 'MasonInstallR' for framework-specific tool installation

Signed-off-by: User <user@example.com>
This commit is contained in:
User 2025-10-11 16:12:51 +00:00
parent 7f725c6530
commit 018b471b72
4 changed files with 93 additions and 57 deletions

View File

@ -33,12 +33,15 @@
"nvim-dap": { "branch": "master", "commit": "7367cec8e8f7a0b1e4566af9a7ef5959d11206a7" }, "nvim-dap": { "branch": "master", "commit": "7367cec8e8f7a0b1e4566af9a7ef5959d11206a7" },
"nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, "nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" },
"nvim-highlight-colors": { "branch": "main", "commit": "e0c4a58ec8c3ca7c92d3ee4eb3bc1dd0f7be317e" }, "nvim-highlight-colors": { "branch": "main", "commit": "e0c4a58ec8c3ca7c92d3ee4eb3bc1dd0f7be317e" },
"nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" },
"nvim-lspconfig": { "branch": "master", "commit": "fa2662510d30b06168b6e2e6915518decde6bbac" }, "nvim-lspconfig": { "branch": "master", "commit": "fa2662510d30b06168b6e2e6915518decde6bbac" },
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" },
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" }, "nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },
"nvim-vtsls": { "branch": "main", "commit": "0b5f73c9e50ce95842ea07bb3f05c7d66d87d14a" },
"nvim-window-picker": { "branch": "main", "commit": "6382540b2ae5de6c793d4aa2e3fe6dbb518505ec" }, "nvim-window-picker": { "branch": "main", "commit": "6382540b2ae5de6c793d4aa2e3fe6dbb518505ec" },
"package-info.nvim": { "branch": "master", "commit": "a1de9eb91fa52ab8361f0c05032673670a3d10ff" },
"pendulum-nvim": { "branch": "main", "commit": "c129ae3d69f164b3e51e067b0eca45a8d3da29ee" }, "pendulum-nvim": { "branch": "main", "commit": "c129ae3d69f164b3e51e067b0eca45a8d3da29ee" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"resession.nvim": { "branch": "master", "commit": "cc819b0489938d03e4f3532a583354f0287c015b" }, "resession.nvim": { "branch": "master", "commit": "cc819b0489938d03e4f3532a583354f0287c015b" },
@ -46,6 +49,7 @@
"snacks.nvim": { "branch": "main", "commit": "da230e3ca8146da4b73752daaf0a1d07d343c12d" }, "snacks.nvim": { "branch": "main", "commit": "da230e3ca8146da4b73752daaf0a1d07d343c12d" },
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
"tsc.nvim": { "branch": "main", "commit": "8c1b4ec6a48d038a79ced8674cb15e7db6dd8ef0" },
"vim-illuminate": { "branch": "master", "commit": "0d1e93684da00ab7c057410fecfc24f434698898" }, "vim-illuminate": { "branch": "master", "commit": "0d1e93684da00ab7c057410fecfc24f434698898" },
"which-key.nvim": { "branch": "main", "commit": "fcbf4eea17cb299c02557d576f0d568878e354a4" } "which-key.nvim": { "branch": "main", "commit": "fcbf4eea17cb299c02557d576f0d568878e354a4" }
} }

View File

@ -60,14 +60,22 @@ local function get_ai_modules()
return nil return nil
end end
---@type LazySpec ---@type LazySpec[]
return { local modules = {
-- Base AstroCommunity plugin -- Base AstroCommunity plugin
"AstroNvim/astrocommunity", "AstroNvim/astrocommunity",
-- Framework-specific modules
unpack(get_framework_modules()),
-- AI modules if enabled
get_ai_modules(),
} }
-- Add framework-specific modules
local framework_modules = get_framework_modules()
for _, module in ipairs(framework_modules) do
table.insert(modules, module)
end
-- Add AI modules if enabled
local ai_module = get_ai_modules()
if ai_module then
table.insert(modules, ai_module)
end
return modules

View File

@ -1,47 +0,0 @@
-- Mason plugin configuration for automatic tool installation
-- Dynamically installs tools based on the FRAMEWORK environment variable
-- Framework-specific tool configurations
local FRAMEWORK_TOOLS = {
python = {
"black",
"python-lsp-server",
"mypy",
"pylint",
"flake8",
"pylama",
"bandit",
"pydocstyle",
"pyproject-flake8",
"pyproject-fmt",
"reorder-python-imports",
},
vue = {
"eslint-lsp",
"stylelint-lsp",
"tailwindcss-language-server",
"typescript-language-server",
"vue-language-server",
"stylelint",
"prettier",
}
}
--- Retrieves the appropriate tool set based on the current framework environment
--- @return table List of tools to install for the detected framework
local function get_framework_tools()
local current_framework = os.getenv("FRAMEWORK")
return FRAMEWORK_TOOLS[current_framework] or {}
end
---@type LazySpec
return {
-- Mason tool installer for automatic package management
{
"WhoIsSethDaniel/mason-tool-installer.nvim",
opts = {
-- Install tools based on the detected framework
ensure_installed = get_framework_tools(),
},
},
}

View File

@ -1,5 +1,76 @@
if true then return end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
-- This will run last in the setup process. -- This will run last in the setup process.
-- This is just pure lua so anything that doesn't -- This is just pure lua so anything that doesn't
-- fit in the normal config locations above can go here -- fit in the normal config locations above can go here
-- Framework-specific tool configurations
local FRAMEWORK_TOOLS = {
python = {
"black",
"python-lsp-server",
"mypy",
"pylint",
"flake8",
"pylama",
"bandit",
"pydocstyle",
"pyproject-flake8",
"pyproject-fmt",
"reorder-python-imports",
},
vue = {
"eslint-lsp",
"stylelint-lsp",
"tailwindcss-language-server",
"typescript-language-server",
"stylelint",
"prettier",
},
}
--- Retrieves the appropriate tool set based on the current framework environment
--- @return table List of tools to install for the detected framework
local function get_framework_tools()
local current_framework = os.getenv "FRAMEWORK"
print("[DEBUG] Current FRAMEWORK environment variable: " .. tostring(current_framework))
if current_framework then
print("[DEBUG] Available frameworks: " .. vim.inspect(vim.tbl_keys(FRAMEWORK_TOOLS)))
local tools = FRAMEWORK_TOOLS[current_framework]
print("[DEBUG] Tools for framework '" .. current_framework .. "': " .. vim.inspect(tools))
return tools or {}
else
print "[DEBUG] No FRAMEWORK environment variable set, returning empty list"
return {}
end
end
-- Функция для установки списка пакетов Mason
function InstallMyMasonPackages()
print "[DEBUG] Starting InstallMyMasonPackages function"
local packages = get_framework_tools()
print("[DEBUG] Packages to install: " .. vim.inspect(packages))
if #packages > 0 then
-- Install packages one by one to handle individual failures
for _, package in ipairs(packages) do
print("[DEBUG] Installing package: " .. package)
local success, result = pcall(function() vim.cmd("MasonInstall " .. package) end)
if not success then
print("[WARNING] Failed to install " .. package .. ": " .. tostring(result))
else
print("[DEBUG] Successfully installed " .. package)
end
end
print "[DEBUG] MasonInstall process completed"
else
print "[DEBUG] No packages to install, skipping MasonInstall"
end
end
-- Создание пользовательской команды
vim.api.nvim_create_user_command(
"MasonInstallR", -- Имя команды
InstallMyMasonPackages, -- Вызываемая функция
{ nargs = 0 } -- Команда не принимает аргументов
)