Compare commits
1 Commits
b548abcf80
...
cbcd262024
| Author | SHA1 | Date | |
|---|---|---|---|
| cbcd262024 |
@@ -58,7 +58,7 @@ CSS, JSON, YAML, Markdown, SQL, Dockerfile, Python.
|
|||||||
| LSP | nvim-lspconfig + Mason (`gopls`, `zls`, `lua_ls`, `ts_ls`, `html`, `cssls`, `jsonls`, `yamlls`, `marksman`, `sqlls`, `dockerls`, `pyright`/`ruff`) |
|
| LSP | nvim-lspconfig + Mason (`gopls`, `zls`, `lua_ls`, `ts_ls`, `html`, `cssls`, `jsonls`, `yamlls`, `marksman`, `sqlls`, `dockerls`, `pyright`/`ruff`) |
|
||||||
| Completion | blink.cmp (LazyVim default; SQL routed to dadbod) |
|
| Completion | blink.cmp (LazyVim default; SQL routed to dadbod) |
|
||||||
| Formatting | conform.nvim via LazyVim's format pipeline |
|
| Formatting | conform.nvim via LazyVim's format pipeline |
|
||||||
| Debugging | nvim-dap + delve (Go), codelldb (Zig/C/C++) |
|
| Debugging | nvim-dap + delve (Go), codelldb (Zig/C/C++/Odin) |
|
||||||
| Testing | neotest (Go, Python, Zig) with in-buffer pass/fail signs |
|
| Testing | neotest (Go, Python, Zig) with in-buffer pass/fail signs |
|
||||||
| Coverage | nvim-coverage (Go) |
|
| Coverage | nvim-coverage (Go) |
|
||||||
| Task running | overseer.nvim (+ user templates) |
|
| Task running | overseer.nvim (+ user templates) |
|
||||||
@@ -143,9 +143,13 @@ Works in Go, Python, and Zig buffers; results show as signs in the gutter.
|
|||||||
|
|
||||||
### Debugging (DAP, `<leader>d`)
|
### Debugging (DAP, `<leader>d`)
|
||||||
|
|
||||||
Go uses delve; Zig/C/C++ use codelldb. Zig launch configs build with debug
|
Go uses delve; Zig/C/C++/Odin use codelldb. Zig launch configs build with
|
||||||
symbols first, then run (`Launch (zig build)` prompts for the exe under
|
debug symbols first, then run (`Launch (zig build)` prompts for the exe under
|
||||||
`zig-out/bin`; `Launch (current file)` compiles the open file).
|
`zig-out/bin`; `Launch (current file)` compiles the open file). Odin offers
|
||||||
|
`Launch (make build-debug)` (desi_explorer-style monorepo — runs
|
||||||
|
`make -C gui build-debug` and points at `bin/desi_explorer` with the repo's
|
||||||
|
`GUI_ENV_FILE`), `Launch (odin build .)` (plain debug `odin build`), and
|
||||||
|
`Launch (current file)`.
|
||||||
| Key | Action |
|
| Key | Action |
|
||||||
|-----|--------|
|
|-----|--------|
|
||||||
| `<leader>db` | Toggle breakpoint |
|
| `<leader>db` | Toggle breakpoint |
|
||||||
@@ -270,7 +274,7 @@ symbols first, then run (`Launch (zig build)` prompts for the exe under
|
|||||||
│ │ ├── lspconfig.lua # Per-server LSP config (gopls, zls, …)
|
│ │ ├── lspconfig.lua # Per-server LSP config (gopls, zls, …)
|
||||||
│ │ ├── treesitter.lua # Parsers
|
│ │ ├── treesitter.lua # Parsers
|
||||||
│ │ ├── formatting.lua # conform.nvim
|
│ │ ├── formatting.lua # conform.nvim
|
||||||
│ │ ├── dap.lua # Debugging (Go via delve, Zig via codelldb)
|
│ │ ├── dap.lua # Debugging (Go via delve, Zig/C/C++/Odin via codelldb)
|
||||||
│ │ ├── neotest.lua # Test runner (go/python/zig)
|
│ │ ├── neotest.lua # Test runner (go/python/zig)
|
||||||
│ │ ├── go-coverage.lua # Go coverage signs
|
│ │ ├── go-coverage.lua # Go coverage signs
|
||||||
│ │ ├── overseer.lua # Task runner
|
│ │ ├── overseer.lua # Task runner
|
||||||
@@ -284,7 +288,7 @@ symbols first, then run (`Launch (zig build)` prompts for the exe under
|
|||||||
│ │ ├── performance.lua # treesitter large-file guard
|
│ │ ├── performance.lua # treesitter large-file guard
|
||||||
│ │ ├── theme.lua # catppuccin
|
│ │ ├── theme.lua # catppuccin
|
||||||
│ │ └── zig.lua # Zig ft plugin (toolchain wired across files)
|
│ │ └── zig.lua # Zig ft plugin (toolchain wired across files)
|
||||||
│ └── overseer/template/user/ # go_*, zig_{build,run,test} task templates
|
│ └── overseer/template/user/ # go_*, odin_{build,run,test}, zig_{build,run,test} task templates
|
||||||
```
|
```
|
||||||
|
|
||||||
## Zig notes
|
## Zig notes
|
||||||
@@ -296,6 +300,16 @@ symbols first, then run (`Launch (zig build)` prompts for the exe under
|
|||||||
- Debugging needs `codelldb` (`:MasonInstall codelldb` if it doesn't
|
- Debugging needs `codelldb` (`:MasonInstall codelldb` if it doesn't
|
||||||
auto-install). Builds use `-O Debug` so symbols are present.
|
auto-install). Builds use `-O Debug` so symbols are present.
|
||||||
|
|
||||||
|
## Odin notes
|
||||||
|
|
||||||
|
- LSP is `ols` (Mason + `lua/plugins/lspconfig.lua`); formatting is `odinfmt`.
|
||||||
|
- Debugging uses **codelldb** with `-o:none -debug` builds, so real breakpoints,
|
||||||
|
locals/variables, and REPL evaluation work against Odin DWARF. The monorepo
|
||||||
|
launch config sets `GUI_ENV_FILE` for you, matching `make run`.
|
||||||
|
- In desi_explorer, `make -C gui build-debug` must finish before
|
||||||
|
`Launch (make build-debug)` — the config builds first, so breakpoints set in
|
||||||
|
`gui/src/*.odin` before launching are hit reliably.
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
- **LSP not attaching:** `:checkhealth lsp` — confirm the server appears and is
|
- **LSP not attaching:** `:checkhealth lsp` — confirm the server appears and is
|
||||||
|
|||||||
@@ -229,6 +229,99 @@ return {
|
|||||||
dap.configurations.cpp = dap.configurations.zig
|
dap.configurations.cpp = dap.configurations.zig
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- -------------------------------------------------------------------------
|
||||||
|
-- Odin debugging via codelldb (same adapter as Zig/C/C++)
|
||||||
|
-- -------------------------------------------------------------------------
|
||||||
|
{
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
ft = { "odin" },
|
||||||
|
config = function()
|
||||||
|
local dap = require("dap")
|
||||||
|
|
||||||
|
-- Prefer codelldb on $PATH, fall back to Mason's install location
|
||||||
|
local codelldb = vim.fn.exepath("codelldb")
|
||||||
|
if codelldb == "" then
|
||||||
|
codelldb = vim.fn.stdpath("data") .. "/mason/bin/codelldb"
|
||||||
|
end
|
||||||
|
|
||||||
|
dap.adapters.codelldb = {
|
||||||
|
type = "server",
|
||||||
|
port = "${port}",
|
||||||
|
executable = {
|
||||||
|
command = codelldb,
|
||||||
|
args = { "--port", "${port}" },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
local root = vim.fn.getcwd()
|
||||||
|
|
||||||
|
-- Detect the repo's GUI env file so the app bootstraps its config the
|
||||||
|
-- same way `make run` does (GUI_ENV_FILE -> dotenv in config.odin).
|
||||||
|
local env_file
|
||||||
|
for _, candidate in ipairs({ "resources/dev/gui.env", ".env" }) do
|
||||||
|
local p = root .. "/" .. candidate
|
||||||
|
if vim.fn.filereadable(p) == 1 then
|
||||||
|
env_file = p
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
local env = {}
|
||||||
|
if env_file then
|
||||||
|
env.GUI_ENV_FILE = env_file
|
||||||
|
end
|
||||||
|
|
||||||
|
dap.configurations.odin = {
|
||||||
|
{
|
||||||
|
-- desi_explorer-style monorepo: `make -C gui build-debug` (-o:none
|
||||||
|
-- -debug), then launch bin/desi_explorer with the GUI env file.
|
||||||
|
name = "Launch (make build-debug)",
|
||||||
|
type = "codelldb",
|
||||||
|
request = "launch",
|
||||||
|
program = function()
|
||||||
|
if vim.fn.glob(root .. "/gui/Makefile") ~= "" then
|
||||||
|
vim.fn.system({ "make", "-C", root .. "/gui", "build-debug" })
|
||||||
|
return root .. "/bin/desi_explorer"
|
||||||
|
end
|
||||||
|
vim.fn.system({ "odin", "build", ".", "-o:none", "-debug", "-out:.debug_out" })
|
||||||
|
return root .. "/.debug_out"
|
||||||
|
end,
|
||||||
|
cwd = root,
|
||||||
|
stopOnEntry = false,
|
||||||
|
args = {},
|
||||||
|
env = env,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
-- Any standalone Odin project: plain `odin build .` with debug info.
|
||||||
|
name = "Launch (odin build .)",
|
||||||
|
type = "codelldb",
|
||||||
|
request = "launch",
|
||||||
|
program = function()
|
||||||
|
vim.fn.system({ "odin", "build", ".", "-o:none", "-debug", "-out:.debug_out" })
|
||||||
|
return root .. "/.debug_out"
|
||||||
|
end,
|
||||||
|
cwd = root,
|
||||||
|
stopOnEntry = false,
|
||||||
|
args = {},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
-- Single-file Odin programs (hello.odin, small scripts)
|
||||||
|
name = "Launch (current file)",
|
||||||
|
type = "codelldb",
|
||||||
|
request = "launch",
|
||||||
|
program = function()
|
||||||
|
local src = vim.fn.expand("%:p")
|
||||||
|
local out = vim.fn.expand("%:p:r") .. "_debug"
|
||||||
|
vim.fn.system({ "odin", "build", src, "-o:none", "-debug", "-out:" .. out })
|
||||||
|
return out
|
||||||
|
end,
|
||||||
|
cwd = "${workspaceFolder}",
|
||||||
|
stopOnEntry = false,
|
||||||
|
args = {},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
-- ─────────────────────────────────────────────────────────────────────────
|
-- ─────────────────────────────────────────────────────────────────────────
|
||||||
-- DAP UI keymaps + auto open/close (the spec itself is loaded as a dep above)
|
-- DAP UI keymaps + auto open/close (the spec itself is loaded as a dep above)
|
||||||
-- ─────────────────────────────────────────────────────────────────────────
|
-- ─────────────────────────────────────────────────────────────────────────
|
||||||
|
|||||||
Reference in New Issue
Block a user