-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathmetals.lua
More file actions
30 lines (29 loc) · 904 Bytes
/
metals.lua
File metadata and controls
30 lines (29 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
local M = {}
local metals_config = require("metals").bare_config()
metals_config.settings = {
showImplicitArguments = true,
excludedPackages = {
"akka.actor.typed.javadsl",
"com.github.swagger.akka.javadsl",
},
ammoniteJvmProperties = { "-Xmx1G", "-Xms100M", "-XX:+UseZGC" },
serverProperties = { "-Xmx1G", "-Xms100M", "-XX:+UseZGC" },
}
-- metals_config.init_options.statusBarProvider = "on"
M.setup = function(opt)
metals_config.capabilities = opt.capabilities
metals_config.on_attach = function(client, buffer)
if opt.on_attach then
opt.on_attach(client, buffer)
end
end
local group = vim.api.nvim_create_augroup("kide_metals", { clear = true })
vim.api.nvim_create_autocmd({ "FileType" }, {
group = group,
pattern = { "scala", "sbt" },
callback = function()
require("metals").initialize_or_attach(metals_config)
end,
})
end
return M