Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion debug_adapter_schemas/Xdebug.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@
"description": "The PHP script to debug (typically a path to a file)",
"default": "${file}"
},
"runtimeExecutable": {
"type": "string",
"description": "Path to the PHP executable the adapter spawns (default: `php` on your PATH)"
},
"runtimeArgs": {
"type": "array",
"items": {
"type": "string"
},
"description": "Arguments passed to the PHP executable before the program (for example `-dxdebug.mode=debug`)"
},
"cwd": {
"type": "string",
"description": "Working directory for the debugged program"
Expand Down Expand Up @@ -165,5 +176,5 @@
}
}
},
"required": ["request", "program"]
"required": ["request"]
}
2 changes: 2 additions & 0 deletions extension.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ language_ids = { PHP = "php" }

[debug_adapters.Xdebug]

[debug_locators.php]

[grammars.php]
repository = "https://github.com/tree-sitter/tree-sitter-php"
commit = "5b5627faaa290d89eb3d01b9bf47c3bb9e797dea"
Expand Down
1 change: 1 addition & 0 deletions languages/php/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ prettier_parser_name = "php"
prettier_plugins = ["@prettier/plugin-php"]
completion_query_characters = ["$"]
word_characters = ["$"]
debuggers = ["Xdebug"]
12 changes: 11 additions & 1 deletion src/php.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::fs;
use zed::CodeLabel;
use zed_extension_api::{
self as zed, DebugConfig, DebugScenario, LanguageServerId, Result,
StartDebuggingRequestArgumentsRequest, serde_json,
StartDebuggingRequestArgumentsRequest, TaskTemplate, serde_json,
};

use crate::{
Expand Down Expand Up @@ -166,6 +166,16 @@ impl zed::Extension for PhpExtension {
self.xdebug
.get_binary(config, user_provided_debug_adapter_path, worktree)
}
fn dap_locator_create_scenario(
&mut self,
_locator_name: String,
build_task: TaskTemplate,
resolved_label: String,
debug_adapter_name: String,
) -> Option<DebugScenario> {
self.xdebug
.dap_locator_create_scenario(build_task, resolved_label, debug_adapter_name)
}
}

zed::register_extension!(PhpExtension);
Loading
Loading