Skip to content

Commit 516d5bb

Browse files
committed
Update outdated launch.json docs
Didn't reflect the changes made in #1237
1 parent ffb077e commit 516d5bb

File tree

2 files changed

+5
-30
lines changed

2 files changed

+5
-30
lines changed

doc/dap.txt

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,12 @@ DEBUGEE CONFIGURATION via launch.json *dap-launch.json*
326326

327327
nvim-dap supports a subset of the `launch.json` file format used to configure
328328
debug adapters in Visual Studio Code.
329-
330-
To load a `launch.json` file, use the `load_launchjs` function from the
331-
`dap.ext.vscode` module.
329+
`.vscode/launch.json` are read automatically whenever you start a new debug
330+
session using |dap.continue()| or `:DapNew`. (via a configuration provider,
331+
see |dap-providers-configs|)
332332

333333
Unlike VS Code, nvim-dap supports standard JSON. Trailing commas on the
334334
last item of a list are an error.
335-
336335
If you install a 3rd-party json5 parser you can override the json decode
337336
function to support json5 features like trailing comma.
338337
>
@@ -341,23 +340,7 @@ function to support json5 features like trailing comma.
341340
(One json5 parser implementation is https://github.com/Joakker/lua-json5)
342341

343342

344-
load_launchjs({path}, {type_to_filetypes}) *dap.ext.vscode.load_launchjs*
345-
346-
Parses a JSON file at {path} and adds the entries to `dap.configurations`.
347-
Configurations are overwritten by name, so if filetype and name matches a
348-
configuration in `dap.configurations`, the config is overwritten by the
349-
one loaded from the file at {path}.
350-
351-
Parameters:
352-
{path} Path to the `launch.json` file. Defaults to
353-
`.vscode/launch.json` in the current working directory.
354-
355-
{type_to_filetypes} A table mapping `type` values in `launch.json` to
356-
one or more filetypes.
357-
By default, the `type` values in `launch.json` will
358-
be used as filetypes verbatim.
359-
360-
An example `launch.json` might look like this:
343+
An example `launch.json` looks like this:
361344

362345
>json
363346
{
@@ -377,15 +360,6 @@ An example `launch.json` might look like this:
377360
}
378361
<
379362

380-
For the above configuration, calling `load_launchjs` adds the first entry to
381-
`dap.configurations.java` and the second entry to `dap.configurations.cppdbg`.
382-
If you wanted to add the second entry to the `c` or `cpp` configurations you
383-
could call `load_launchjs` like this instead:
384-
>
385-
>lua
386-
require('dap.ext.vscode').load_launchjs(nil, { cppdbg = {'c', 'cpp'} })
387-
<
388-
389363
load_launchjs supports `inputs`. Inputs can be used to define custom input prompts.
390364
They are declared in an "inputs" array and each input must have the following properties:
391365

lua/dap/ext/vscode.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ end
197197

198198

199199
--- Extends dap.configurations with entries read from .vscode/launch.json
200+
---@deprecated
200201
function M.load_launchjs(path, type_to_filetypes)
201202
type_to_filetypes = vim.tbl_extend('keep', type_to_filetypes or {}, M.type_to_filetypes)
202203
local configurations = M.getconfigs(path)

0 commit comments

Comments
 (0)