Skip to content

Extend DebugArgumentValue #14282

@ekes

Description

@ekes

vscode-php-xdebug configuration #7574 deprecates the simple serverSourceRoot localSourceRoute keys, and moves to have a hash like

"pathMappings": {
   "/var/www/html": "/path/to/html",
   "/app": "/path/to/app"
}

References: https://github.com/xdebug/vscode-php-debug?tab=readme-ov-file#supported-launchjson-settings and https://github.com/xdebug/vscode-php-debug/blob/bcb2ba1b806be0bbfe04b766f2cf31303dd5dc00/package.json#L256

@mattriverm noted:

To support a table of pathmappings like the below example, the helix config (DebugArgumentValue) needs to be extended.

[[language.debugger.templates]]
name = "Listen for Xdebug"
request = "launch"
completion = ["ignored"]

[language.debugger.templates.args]
port = "9001"

[language.debugger.templates.args.pathMappings]
"/some/path/on/server" = "/some/path"
"/another/server/path" = "/another/local/path"

I believe it is a simple change, if there is an issue filed I could attempt a PR.
Regarding substitution, not sure. Might be simple to look for {workspaceFolder} and replace with cwd, or helix concept of root folder.

Originally posted by @mattriverm in #7574 (reply in thread)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions