Merge branch '18254-use-better_errors-editor-links-in-sherlock' into 'master'

Use better_errors editor links in sherlock

Closes #18254. Uses the same editor configuration of `better_errors`
so that you don't have to configure things twice. Remember to have a
custom initializer that specifies your editor.

Example for atom. File `config/initializers/better_errors.rb`:
````ruby
if defined?(BetterErrors)
  BetterErrors.editor = "atm://open?url=file://%{file}&line=%{line}"
end
````

See merge request !4497
This commit is contained in:
Robert Speicher 2016-06-07 02:02:23 +00:00
commit 1386013abd
2 changed files with 11 additions and 3 deletions

View File

@ -6,7 +6,11 @@
%ul.well-list
- @query.application_backtrace.each do |location|
%li
= location.path
%strong
- if defined?(BetterErrors)
= link_to(location.path, BetterErrors.editor[location.path, location.line])
- else
= location.path
%small.light
= t('sherlock.line')
= location.line

View File

@ -11,13 +11,17 @@
= @query.duration.round(4)
= t('sherlock.milliseconds')
%li
- frame = @query.last_application_frame
%span.light
#{t('sherlock.origin')}:
%strong
= @query.last_application_frame.path
- if defined?(BetterErrors)
= link_to(frame.path, BetterErrors.editor[frame.path, frame.line])
- else
= frame.path
%small.light
= t('sherlock.line')
= @query.last_application_frame.line
= frame.line
.panel.panel-default
.panel-heading