Repository navigation
Send Twig, YAML and XML documents to PHPantom - #155
Open
giuseppe-esposito-87 wants to merge 2 commits into
Open
giuseppe-esposito-87 wants to merge 2 commits into
giuseppe-esposito-87 wants to merge 2 commits into
Conversation
PHPantom answers completion, go-to-definition, references and rename for the names it reads in Twig templates and in YAML and XML configuration (services, routes, templates, translations). The files keep their language; the Twig, YAML and XML extensions keep serving them. Assisted-by: claude-code/claude-opus-5-5
Zed's defaults set no language_servers for these languages, so without this every user of the extension would get PHPantom on any YAML, Twig or XML file, in projects without PHP too. Users enable it per language, ideally in the project settings of a PHP project. Zed versions before 1.24 ignore opt_in_languages. Assisted-by: claude-code/claude-opus-5-5
|
We require contributors to sign our Contributor License Agreement, and we don't have @giuseppe-esposito-87 on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
This was referenced Nov 5, 2026
Author
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets PHPantom serve Twig templates and YAML and XML configuration files, as the VS Code extension already does. PHPantom answers completion, go to definition, references and rename for the names a PHP project writes in those files: Symfony and Drupal services, routes, templates and translation keys.
opt_in_languages, so PHPantom never starts for them unless a user enables it, and a project without PHP is unaffected. Zed versions before 1.24 ignore that key.To enable it, add PHPantom to the language, ideally in a PHP project's
.zed/settings.json:{ "languages": { "YAML": { "language_servers": ["phpantom", "..."] }, "Twig": { "language_servers": ["phpantom", "..."] } } }Tested as a dev extension in Zed 1.27 on a Drupal 11 site, with the PHPantom Drupal support from PHPantom-dev/phpantom_lsp#535: go to definition from a routing file to the controller, from a menu link and a Twig
path()to the route, and references from a route to its PHP, YAML and Twig uses. Formatting a YAML file still goes to the YAML extension.