Closed michaelmior closed 7 months ago
Hey @michaelmior so you'll want to switch this up a bit. Inside of opts
you'll basically want to put together all the config, and then return it. Then you'll want to utilize config
to set up an autocmd with that returned config:
config = function(self, metals_config)
local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true })
vim.api.nvim_create_autocmd("FileType", {
pattern = self.ft,
callback = function()
require("metals").initialize_or_attach(metals_config)
end,
group = nvim_metals_group,
})
end
You can see an example of this in the minimal config.
@ckipp01 Thanks! That did the trick. I did look at the page you referenced, but I missed that particular snippet. I think it would be helpful to have such an example in the README for new users.
Describe the bug
I get the error below when opening a Scala project. Despite this error, everything seems to work correctly after dismissing the message.
Below is my config for lazy.nvim
Expected behavior
No error message should be produced
Operating system
macOS
Version of Metals
1.2.2
Commit of nvim-metals
94c8d4d