Skip to content

Add support for VSCode WSL Xdebug links#795

Open
omartins365 wants to merge 4 commits intophp-debugbar:masterfrom
omartins365:master
Open

Add support for VSCode WSL Xdebug links#795
omartins365 wants to merge 4 commits intophp-debugbar:masterfrom
omartins365:master

Conversation

@omartins365
Copy link

This PR adds support for generating Xdebug file links for VSCode WSL (vscode-wsl).

  • Supports custom WSL distro via setter, env var, or default (Ubuntu).
  • Includes PHPUnit tests for all cases.

Example link:
vscode://vscode-remote/wsl+Ubuntu/path/to/file.php:1

@angeljqv
Copy link
Contributor

Since v3 setEditorTemplate

$WslName = getenv('DEBUGBAR_WSL_NAME') ?? 'Ubuntu';
$debugbar->setEditorTemplate("vscode://vscode-remote/wsl+{$WslName}/%f:%l");

/**
* Set the editor link template globally,
* `%f` = file, `%l` = line, e.g., `vscode://file/%f:%l`
*/
public function setEditorTemplate(string $editorLinkTemplate, bool $shouldUseAjax = false): void

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants