Add DAP support for metals
This commit is contained in:
parent
392766d103
commit
94ce66c22c
3 changed files with 44 additions and 6 deletions
|
@ -4,9 +4,36 @@ if (not status) then return function() end end
|
|||
return function(on_attach)
|
||||
metals_config = metals.bare_config()
|
||||
metals_config.init_options.statusBarProvider = "on"
|
||||
metals_config.settings = { showImplicitArguments = true }
|
||||
metals_config.on_attach = on_attach
|
||||
metals_config.settings = {
|
||||
showImplicitArguments = true,
|
||||
superMethodLensesEnabled = true,
|
||||
}
|
||||
metals_config.on_attach = function(client, bufnr)
|
||||
require("metals").setup_dap()
|
||||
on_attach(client, bufnr)
|
||||
end
|
||||
metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
-- Debug settings if you're using nvim-dap
|
||||
local dap = require("dap")
|
||||
dap.configurations.scala = {
|
||||
{
|
||||
type = "scala",
|
||||
request = "launch",
|
||||
name = "RunOrTest",
|
||||
metals = {
|
||||
runType = "runOrTestFile",
|
||||
--args = { "firstArg", "secondArg", "thirdArg" }, -- here just as an example
|
||||
},
|
||||
},
|
||||
{
|
||||
type = "scala",
|
||||
request = "launch",
|
||||
name = "Test Target",
|
||||
metals = {
|
||||
runType = "testTarget",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
vim.cmd [[augroup lsp]]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue