aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/nvim/.config/nvim/lua/tobyvin/dap/configs.lua
blob: 7f8b47df4d3c1259739453f348034b7f6d9aa2a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
local M = {
	lua = {
		{
			name = "Attach to running Neovim instance",
			type = "nlua",
			request = "attach",
			host = function()
				local host
				vim.ui.input({ prompt = "Host: ", default = "127.0.0.1" }, function(input)
					host = input
				end)
				return host
			end,
			port = function()
				local host
				vim.ui.input({ prompt = "Port: ", default = "7777" }, function(input)
					host = input
				end)
				return host
			end,
		},
	},
	c = {
		{
			name = "Launch",
			type = "codelldb",
			request = "launch",
			program = function()
				return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
			end,
			cwd = "${workspaceFolder}",
			stopOnEntry = false,
			runInTerminal = false,
		},
	},
	cpp = {
		{
			name = "Launch",
			type = "codelldb",
			request = "launch",
			program = function()
				return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
			end,
			cwd = "${workspaceFolder}",
			stopOnEntry = false,
			runInTerminal = false,
		},
	},
	rust = {
		{
			name = "build",
			type = "codelldb",
			request = "launch",
			cargo = {
				args = { "build" },
			},
			cwd = "${workspaceFolder}",
			stopOnEntry = false,
			terminal = "console",
		},
		{
			name = "test --lib",
			type = "codelldb",
			request = "launch",
			cargo = {
				args = { "test", "--no-run", "--lib" },
			},
			cwd = "${workspaceFolder}",
			stopOnEntry = false,
			terminal = "console",
		},
	},
}

return M