module DEBUGGER__::SkipPathHelper

def skip_config_skip_path?(path)

def skip_config_skip_path?(path)
  (skip_paths = CONFIG[:skip_path]) && skip_paths.any?{|skip_path| path.match?(skip_path)}
end

def skip_internal_path?(path)

def skip_internal_path?(path)
  path.start_with?(__dir__) || path.delete_prefix('!eval:').start_with?('<internal:')
end

def skip_location?(loc)

def skip_location?(loc)
  loc_path = loc.absolute_path || "!eval:#{loc.path}"
  skip_path?(loc_path)
end

def skip_path?(path)

def skip_path?(path)
  !path ||
  DEBUGGER__.skip? ||
  ThreadClient.current.management? ||
  skip_internal_path?(path) ||
  skip_config_skip_path?(path)
end