add metals
This commit is contained in:
parent
08163e8d05
commit
a8d1ecdc07
1 changed files with 27 additions and 0 deletions
27
lua/plugins/nvim-metals.lua
Normal file
27
lua/plugins/nvim-metals.lua
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
return {
|
||||||
|
"scalameta/nvim-metals",
|
||||||
|
keys = {
|
||||||
|
{ "<leader>ws", "<cmd>lua require'metals'.hover_worksheet()<cr>", desc = "Metals Worksheet" },
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local metals_config = require("metals").bare_config()
|
||||||
|
|
||||||
|
metals_config.settings = {
|
||||||
|
showImplicitArguments = true,
|
||||||
|
excludedPackages = { "akka.actor.typed.javadsl", "com.github.swagger.akka.javadsl" },
|
||||||
|
}
|
||||||
|
|
||||||
|
metals_config.init_options.statusBarProvider = "on"
|
||||||
|
|
||||||
|
metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
|
||||||
|
local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true })
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = { "scala", "sbt", "java" },
|
||||||
|
callback = function()
|
||||||
|
require("metals").initialize_or_attach(metals_config)
|
||||||
|
end,
|
||||||
|
group = nvim_metals_group,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
Loading…
Reference in a new issue