Skip to content

Conversation

federicobond
Copy link
Contributor

Description

This adds a setting to configure an Open in editor URL when you click on a template path. Makes it easier to jump directly to the template and edit. Can develop it further and/or add tests if there is interest in the feature.

Captura de pantalla 2025-09-13 a la(s) 23 04 38

Checklist:

  • I have added the relevant tests for this change.
  • I have added an item to the Pending section of docs/changes.rst.


This function is passed a file path and should return a URL to open the file in
the editor. For example, to open the file in VS Code, you can use:
``lambda f: f"vscode://file/{f}"``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this ever not going to be a static prefix with the filename after it? I think if we can remove the lambda, that would be better.

Copy link
Contributor Author

@federicobond federicobond Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in every case, but an alternative is to own the different formats ourselves like the PHP Debug Bar does.

It's a better UX for most people and lets us add line references later at the cost of a more restricted set of supported editors.

See https://github.com/php-debugbar/php-debugbar/blob/c9a88bbc89958ccdab95734ad396cc82f8c65e43/src/DebugBar/DataFormatter/HasXdebugLinks.php#L107-L129

Copy link
Member

@tim-schilling tim-schilling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it's possible to detect that the project is running in vscode and we could avoid the setting altogether?

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.

2 participants