Breaking Changes (Please Subscribe) #253
Replies: 8 comments 3 replies
-
#255 introduces a breaking change in the way that you need to use How to MigrateIn your config wherever you access the - Metals_config = require("metals").bare_config
+ Metals_config = require("metals").bare_config() If you don't make this change, you'll end up seeing the following error:
|
Beta Was this translation helpful? Give feedback.
-
#276 deprecates the Metals_config = require("metals").bare_config()
Metals_config.settings = {
serverVersion = "0.10.9+126-14672630-SNAPSHOT"
} This also applies to the NOTE: As an aside this change also introduces a new way to keep up to date with the latest snapshot version without needing to go look on the website. If you use |
Beta Was this translation helpful? Give feedback.
-
TLDRUpdate to v.0.6.0 Longer explanationAs of #283 the minimum version of Neovim that is required in v0.6.0. You should be able to just update and be set unless you had customer handlers that you were overriding in function(err, result, context, config) The other feature that we make use of is the As always, don't hesitate to reach out if you hit on something. |
Beta Was this translation helpful? Give feedback.
-
As of #290 the vim.diagnostic.setqflist() // This open the qf with all workspace diagnostics
vim.diagnostic.setqflist({severity = "E"}) // same as the above, but only errors
vim.diagnostic.setqflist({severity = "W"}) // same as the above, but with only warnings |
Beta Was this translation helpful? Give feedback.
-
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 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 |
Beta Was this translation helpful? Give feedback.
-
So a very small breaking change in the lua API for You can see the changes in #516. |
Beta Was this translation helpful? Give feedback.
-
In #552 there are a couple small changes to the Lua API to making the meaning of certain commands clearer.
|
Beta Was this translation helpful? Give feedback.
-
Just a heads up that it will now be required for users to be on at least 0.9.x of Neovim as I'm staring to use some of the new APIs that were released. For those of you that may be stuck for whatever reason you can target the v0.8.x tag, just know that there will be no more ongoing work there. |
Beta Was this translation helpful? Give feedback.
-
When I first started
nvim-metals
I had never touched Lua before. I made some newbie mistakes, which is to be expected when getting started with a language. While I still consider myself pretty amateur with Lua, I'm at least seeing some of the mistakes I made early on which are now pain points as I've tried to add tests. With that in mind, I don't take breaking changes lightly, and I'm more than aware of how annoying they are for users. With that being said, there will be times I'll need to make them, and I'd like them to be as painless as possible. So there are a few things you can do to help ensure they are indeed less painful.packer.nvim
you'll get a warning when you updatenvim-metals
when a breaking change occurs. This is because there will be abreaking change
in the commit message which triggers packer to show you the commit. Look at the commit message, it will contain info on what is breaking.Cheers
Beta Was this translation helpful? Give feedback.
All reactions