This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 110499 - enhancement: filter out lines from the stack trace
Summary: enhancement: filter out lines from the stack trace
Status: NEW
Alias: None
Product: ruby
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: PC Windows Vista
: P3 blocker (vote)
Assignee: issues@ruby
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-21 19:52 UTC by jamespb
Modified: 2011-01-28 20:10 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jamespb 2007-07-21 19:52:45 UTC
It'd be useful to have an option in the output window to filter out stack trace lines from Ruby itself, and just show
the lines from my code.

Seems like you could get most of the functionality by a regular expression filter saying "replace any consecutive lines
matching these regular expressions with X", and then users could just put in 

ruby.lib.ruby.gems
ruby.lib.ruby.1.8
vendor.plugins

or whatever made sense for what they were working on.
Comment 1 jamespb 2007-07-21 20:19:08 UTC
Submitted this, then realized it's better to do this in Ruby than in the IDE.  Just do:


module Test
  module Unit
    module Util
      module BacktraceFilter
        def filter_backtrace_with_only_my_code(backtrace, prefix=nil)
          result = filter_backtrace_without_only_my_code backtrace, prefix
          result.reject! {|x| x =~ /ruby.lib.ruby/}
          result.reject! {|x| x =~ /vendor.plugins.mocha/}
          result
        end
        alias_method_chain :filter_backtrace, :only_my_code
      end
    end
  end
end