Skip to content

Commit

Permalink
refactor(dap)!: split dap and dap_ui
Browse files Browse the repository at this point in the history
This Pull Request makes 3 changes to the nvim-dap integration:
1. Splits the dap and dap_ui integrations. Rationale: there's no need for
   both plugins to share a integration. In fact, that's the only
   integration that contains multiple plugins.
2. Adds a missing highlight group to the nvim-dap integration
3. Removes a misguided comment about enabling the nvim-dap integration
  • Loading branch information
igorlfs committed Dec 6, 2023
1 parent 988c0b2 commit ad25404
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 40 deletions.
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -938,22 +938,16 @@ cmp = true
<!-- nvim-dap -->
</tr>
<tr>
<td> <a href="https://github.com/mfussenegger/nvim-dap">nvim-dap</a> & <a href="https://github.com/rcarriga/nvim-dap-ui">nvim-dap-ui</a> </td>
<td> <a href="https://github.com/mfussenegger/nvim-dap">nvim-dap</a> </td>
<td>

```lua
dap = {
enabled = true,
enable_ui = true, -- enable nvim-dap-ui
}
dap = true
```

<details> <summary>Special</a> </summary>

```lua
-- You NEED to override nvim-dap's default highlight groups, AFTER requiring nvim-dap
require("dap")

local sign = vim.fn.sign_define

sign("DapBreakpoint", { text = "", texthl = "DapBreakpoint", linehl = "", numhl = ""})
Expand All @@ -967,6 +961,20 @@ sign("DapLogPoint", { text = "◆", texthl = "DapLogPoint", linehl = "", numhl =
</tr>
<!-- nvim-dap -->

<!-- nvim-dap-ui -->
</tr>
<tr>
<td> <a href="https://github.com/rcarriga/nvim-dap-ui">nvim-dap-ui</a> </td>
<td>

```lua
dap_ui = true,
```

</td>
</tr>
<!-- nvim-dap-ui -->

<!-- nvim-lspconfig -->
</tr>
<tr>
Expand Down
33 changes: 1 addition & 32 deletions lua/catppuccin/groups/integrations/dap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,11 @@ local M = {}

function M.get()
return {
-- nvim-dap
DapBreakpoint = { fg = C.red },
DapBreakpointCondition = { fg = C.yellow },
DapBreakpointRejected = { fg = C.mauve },
DapLogPoint = { fg = C.sky },
DapStopped = { fg = C.maroon },

-- nvim-dap-ui
DAPUIScope = { fg = C.sky },
DAPUIType = { fg = C.mauve },
DAPUIValue = { fg = C.sky },
DAPUIVariable = { fg = C.text },
DapUIModifiedValue = { fg = C.peach },
DapUIDecoration = { fg = C.sky },
DapUIThread = { fg = C.green },
DapUIStoppedThread = { fg = C.sky },
DapUISource = { fg = C.lavender },
DapUILineNumber = { fg = C.sky },
DapUIFloatBorder = { fg = C.sky },

DapUIWatchesEmpty = { fg = C.maroon },
DapUIWatchesValue = { fg = C.green },
DapUIWatchesError = { fg = C.maroon },

DapUIBreakpointsPath = { fg = C.sky },
DapUIBreakpointsInfo = { fg = C.green },
DapUIBreakpointsCurrentLine = { fg = C.green, style = { "bold" } },
DapUIBreakpointsDisabledLine = { fg = C.surface2 },

DapUIStepOver = { fg = C.blue },
DapUIStepInto = { fg = C.blue },
DapUIStepBack = { fg = C.blue },
DapUIStepOut = { fg = C.blue },
DapUIStop = { fg = C.red },
DapUIPlayPause = { fg = C.green },
DapUIRestart = { fg = C.green },
DapUIUnavailable = { fg = C.surface1 },
}
end

Expand Down
37 changes: 37 additions & 0 deletions lua/catppuccin/groups/integrations/dap_ui.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
local M = {}

function M.get()
return {
DAPUIScope = { fg = C.sky },
DAPUIType = { fg = C.mauve },
DAPUIValue = { fg = C.sky },
DAPUIVariable = { fg = C.text },
DapUIModifiedValue = { fg = C.peach },
DapUIDecoration = { fg = C.sky },
DapUIThread = { fg = C.green },
DapUIStoppedThread = { fg = C.sky },
DapUISource = { fg = C.lavender },
DapUILineNumber = { fg = C.sky },
DapUIFloatBorder = { fg = C.sky },

DapUIWatchesEmpty = { fg = C.maroon },
DapUIWatchesValue = { fg = C.green },
DapUIWatchesError = { fg = C.maroon },

DapUIBreakpointsPath = { fg = C.sky },
DapUIBreakpointsInfo = { fg = C.green },
DapUIBreakpointsCurrentLine = { fg = C.green, style = { "bold" } },
DapUIBreakpointsDisabledLine = { fg = C.surface2 },

DapUIStepOver = { fg = C.blue },
DapUIStepInto = { fg = C.blue },
DapUIStepBack = { fg = C.blue },
DapUIStepOut = { fg = C.blue },
DapUIStop = { fg = C.red },
DapUIPlayPause = { fg = C.green },
DapUIRestart = { fg = C.green },
DapUIUnavailable = { fg = C.surface1 },
}
end

return M

0 comments on commit ad25404

Please sign in to comment.