Skip to content

Commit

Permalink
feat(kotlin): adding kotlin-debug-adapter (#26)
Browse files Browse the repository at this point in the history
Co-authored-by: Jay Patel <36803168+jayp0521@users.noreply.github.com>
  • Loading branch information
jay-babu and jay-babu committed Dec 14, 2022
1 parent 48a4aa6 commit 2c97ca2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lua/mason-nvim-dap/mappings/adapters.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ M.mix_task = {
args = {},
}

M.kotlin = {
type = 'executable',
command = 'kotlin-debug-adapter',
args = { '--interpreter=vscode' },
}

M = vim.tbl_deep_extend('force', M, settings.current.automatic_setup.adapters or {})

return M
13 changes: 13 additions & 0 deletions lua/mason-nvim-dap/mappings/configurations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,19 @@ M.elixir = {
},
}

M.kotlin = {
{
type = 'kotlin',
name = 'launch - kotlin',
request = 'launch',
projectRoot = vim.fn.getcwd(),
mainClass = function()
-- return vim.fn.input("Path to main class > ", "myapp.sample.app.AppKt", "file")
return vim.fn.input('Path to main class > ', '', 'file')
end,
},
}

M = vim.tbl_deep_extend('force', M, settings.current.automatic_setup.configurations or {})

return M
1 change: 1 addition & 0 deletions lua/mason-nvim-dap/mappings/filetypes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ M.adapter_to_configs = {
['cppdbg'] = { 'c', 'cpp', 'rust' },
['codelldb'] = { 'c', 'cpp', 'rust' },
['mix_task'] = { 'elixir' },
['kotlin'] = { 'kotlin' },
}

return M
1 change: 1 addition & 0 deletions lua/mason-nvim-dap/mappings/source.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ M.nvim_dap_to_package = {
['mock'] = 'mockdebug',
['puppet'] = 'puppet-editor-services',
['elixir'] = 'elixir-ls',
['kotlin'] = 'kotlin-debug-adapter',
}

M.package_to_nvim_dap = _.invert(M.nvim_dap_to_package)
Expand Down

0 comments on commit 2c97ca2

Please sign in to comment.