Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Implement Whoops feature to open referenced files in editor/IDE#908

Merged
taylorotwell merged 2 commits into
laravel:masterfrom
filp:improve/whoops-open-in-editor
Apr 12, 2013
Merged

Implement Whoops feature to open referenced files in editor/IDE#908
taylorotwell merged 2 commits into
laravel:masterfrom
filp:improve/whoops-open-in-editor

Conversation

@filp
Copy link
Copy Markdown
Contributor

@filp filp commented Apr 12, 2013

This PR updates the filps/whoops dependency to 1.0.1, which includes among other small fixes a feature to enable opening files referenced in the error page in the user's editor/IDE of choice. Required changes to templates & CSS were also ported.

Whoops!

Currently, the feature will not be visible, as no editor is set by default. I've decided against making the choice to structure that myself. My idea was to add another option to app/config/app.php named editor or some such, but there's probably room to allow machine-specific editor choices, loading from environment variables, etc.

Setting an editor is simple:

  1. Check the available editors in PrettyPageHandler
  2. Use PrettyPageHandler::setEditor( string $identifier ) to set an editor by identifier
  3. Alternatively, pass a callable to setEditor that accepts a file path and a line number, and returns a string usable as an href property
  4. Alternatively, add your own editor options with PrettyPageHandler::addEditor(string $identifier, callable)

Finally, @daylerees might want to have a look at my changes to the template and CSS, and tweak them to fit his choices - my solution is far from perfect 😅

Additional info is available in the whoops repo.

Cheers!

taylorotwell added a commit that referenced this pull request Apr 12, 2013
Implement Whoops feature to open referenced files in editor/IDE
@taylorotwell taylorotwell merged commit 67af35f into laravel:master Apr 12, 2013
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