nvim: Support build.mill files
This commit is contained in:
parent
dce67f426f
commit
dc4ddc932c
1 changed files with 28 additions and 0 deletions
|
|
@ -1,4 +1,15 @@
|
||||||
return {
|
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",
|
"neovim/nvim-lspconfig",
|
||||||
opts = {
|
opts = {
|
||||||
|
|
@ -12,6 +23,23 @@ return {
|
||||||
cmd = { "elixir-ls" },
|
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,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue