Skip to content

Commit

Permalink
feat(adapter): add support for dart (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-babu authored Jan 16, 2023
1 parent daa8b6d commit a775db8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 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 @@ -82,6 +82,12 @@ M.kotlin = {
args = { '--interpreter=vscode' },
}

M.dart = {
type = 'executable',
command = 'dart-debug-adapter',
args = { 'flutter' },
}

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 @@ -145,6 +145,7 @@ local function get_dll()
coroutine.resume(dap_run_co, choice)
end
end

vim.ui.select(items, opts, cont)
end)
end
Expand Down Expand Up @@ -213,6 +214,18 @@ M.kotlin = {
},
}

M.dart = {
{
type = 'dart',
request = 'launch',
name = 'Launch flutter',
dartSdkPath = os.getenv('HOME') .. '/flutter/bin/cache/dart-sdk/',
flutterSdkPath = os.getenv('HOME') .. '/flutter',
program = '${workspaceFolder}/lib/main.dart',
cwd = '${workspaceFolder}',
},
}

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

return M
9 changes: 5 additions & 4 deletions lua/mason-nvim-dap/mappings/filetypes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ local M = {}
M.adapter_to_configs = {
['bash'] = { 'sh' },
['chrome'] = { 'javascriptreact', 'typescriptreact', 'typescript', 'javascript' },
['codelldb'] = { 'c', 'cpp', 'rust' },
['coreclr'] = { 'cs', 'fsharp' },
['cppdbg'] = { 'c', 'cpp', 'rust' },
['dart'] = { 'dart' },
['delve'] = { 'go' },
['firefox'] = { 'javascriptreact', 'typescriptreact', 'typescript', 'javascript' },
['kotlin'] = { 'kotlin' },
['mix_task'] = { 'elixir' },
['node2'] = { 'javascriptreact', 'typescriptreact', 'typescript', 'javascript' },
['php'] = { 'php' },
['python'] = { 'python' },
['cppdbg'] = { 'c', 'cpp', 'rust' },
['codelldb'] = { 'c', 'cpp', 'rust' },
['mix_task'] = { 'elixir' },
['kotlin'] = { 'kotlin' },
}

M.adapter_to_configs =
Expand Down
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 @@ -20,6 +20,7 @@ M.nvim_dap_to_package = {
['puppet'] = 'puppet-editor-services',
['elixir'] = 'elixir-ls',
['kotlin'] = 'kotlin-debug-adapter',
['dart'] = 'dart-debug-adapter',
}

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

0 comments on commit a775db8

Please sign in to comment.