Metals command not available #657
-
Hi. init.lua requires the scala module:
My vim.o.shortmess = string.gsub(vim.o.shortmess, 'F', '') .. 'c'
local ft = { "scala", "sbt", "java" }
local metals_config = require("metals").bare_config()
metals_config.settings = {
showImplicitArguments = true
}
--- statusBarProvider
metals_config.init_options.statusBarProvider = "off"
-- make sure the correct capabilities for snippets are set
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 = ft,
callback = function()
require("metals").initialize_or_attach(metals_config)
end,
group = nvim_metals_group,
}) The installation of nvim-metals was successful (I use Vim-Plug for package management .... yes, I know...)
Trying to autocomplete commands Metals* doesn't show anything either.... I've also tried the absolute minimal config which yielded the same results:
What am I missing? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
Hey @voodoojunk, the error makes it seem like Metals isn't actually attached. When you see this can you try to do |
Beta Was this translation helpful? Give feedback.
Well ... no such luck. The log file doesn't exist (though the
~/.cache/nvim/nvim-metals
dir does)I guess I'll have to try to install the language server manually and start it via nvim-lspconfig
I'm not a scala developer. I just need to debug some code once in a while (mostly Apache Spark) so I just need the basic stuff like jump to definition, etc...
Hopefully working with lspconfig would suffice for that
Thanks again for all your help :-)