Breaking Changes (Please Subscribe) · scalameta/nvim-metals · Discussion #253
With the recent release of Neovim 0.7.0 there are some new changes to various apis that make doing things like defining autocmds much cleaner. Therefore I've gone ahead and started using these in a recent commit to nvim-metals. You can see the details here: #369.
While there should be nothing you actually need to change in your config or anything, I marked as a breaking change because it will force you to ensure you have the newest Neovim installed. Updating should be all you need to do. Note that I've also updated the docs to reference the new style of autocmds to setup nvim-metals. For example, in the past you probably had something like this.
vim.cmd [[augroup lsp]] vim.cmd [[au!]] vim.cmd [[au FileType java,scala,sbt lua require("metals").initialize_or_attach({})]] vim.cmd [[augroup end]]
Whereas the new api will allow you to instead do something like this:
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({}) end, group = nvim_metals_group, })
While the old style will still work, I'd recommend switching to the new. However the internal autocmds that nvim-metals sets up will use the new, so that will throw an error if you're on a version of Neovim < 0.7.0.