nvim: Support build.mill files

This commit is contained in:
Paul-Henri Froidmont 2025-10-08 01:32:23 +02:00
parent dce67f426f
commit dc4ddc932c
Signed by: phfroidmont
GPG key ID: BE948AFD7E7873BE

View file

@ -1,4 +1,15 @@
return {
recommended = function()
return LazyVim.extras.wants({
ft = "scala",
root = { "build.sbt", "build.mill", "build.sc", "build.gradle", "pom.xml" },
})
end,
{
"scalameta/nvim-metals",
ft = { "scala", "sbt", "mill" },
config = function() end,
},
{
"neovim/nvim-lspconfig",
opts = {
@ -12,6 +23,23 @@ return {
cmd = { "elixir-ls" },
},
},
setup = {
metals = function(_, opts)
local metals = require("metals")
local metals_config = vim.tbl_deep_extend("force", metals.bare_config(), opts)
metals_config.on_attach = LazyVim.has("nvim-dap") and metals.setup_dap or nil
local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true })
vim.api.nvim_create_autocmd("FileType", {
pattern = { "scala", "sbt", "mill" },
callback = function()
metals.initialize_or_attach(metals_config)
end,
group = nvim_metals_group,
})
return true
end,
},
},
},
}