Skip to content

Commit

Permalink
Validate the VSCode configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
cyb3rd4d committed Jul 19, 2024
1 parent d43aab3 commit 61cd78d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lua/dap-go.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,19 @@ local function setup_delve_adapter(dap, config)
}

dap.adapters.go = function(callback, client_config)
local required_fields = {
"mode",
"port",
"host",
}

for _, field in ipairs(required_fields) do
if client_config[field] == nil then
vim.notify(string.format("missing DAP config key %s", field), vim.log.levels.ERROR)
return
end
end

if client_config.mode ~= "remote" then
callback(delve_config)
return
Expand Down

0 comments on commit 61cd78d

Please sign in to comment.