<commit_before>{View} = require 'atom'
{Stacktrace, PREFIX} = require './stacktrace'

class StacktraceView extends View

  @content: (trace) ->
    @div class: 'stacktrace tool-panel padded', =>
      @div class: 'header panel', =>
        @h2 trace.message
      @div class: 'frames', =>
        for frame in trace.frames
          @subview 'frame', new FrameView(frame)

  initialize: (@trace) ->

  # Internal: Return the window title.
  getTitle: ->
    @trace.message

  # Internal: Register an opener function in the workspace to handle URLs
  # generated by a Stacktrace.
  @registerIn: (workspace) ->
    workspace.registerOpener (filePath) ->
      trace = Stacktrace.forUrl(filePath)
      new StacktraceView(trace) if trace?


class FrameView extends View

  @content: (frame) ->
    @div class: 'frame inset-panel', =>
      @div class: 'panel-heading', =>
        @span class: 'function-name text-highlight inline-block', frame.functionName
        @span class: 'source-location text-subtle inline-block', =>
          @text "#{frame.path} @ #{frame.lineNumber}"
      @div class: 'panel-body padded', =>
        @pre output: 'source', 'Source goes here'

  initialize: (@frame) ->

module.exports =
  StacktraceView: StacktraceView
  FrameView: FrameView
<commit_msg>Fuss with FrameView styles a little.<commit_after>{View} = require 'atom'
{Stacktrace, PREFIX} = require './stacktrace'

class StacktraceView extends View

  @content: (trace) ->
    @div class: 'stacktrace tool-panel padded', =>
      @div class: 'header panel', =>
        @h2 trace.message
      @div class: 'frames', =>
        for frame in trace.frames
          @subview 'frame', new FrameView(frame)

  initialize: (@trace) ->

  # Internal: Return the window title.
  getTitle: ->
    @trace.message

  # Internal: Register an opener function in the workspace to handle URLs
  # generated by a Stacktrace.
  @registerIn: (workspace) ->
    workspace.registerOpener (filePath) ->
      trace = Stacktrace.forUrl(filePath)
      new StacktraceView(trace) if trace?


class FrameView extends View

  @content: (frame) ->
    @div class: 'frame inset-panel', =>
      @div class: 'panel-heading', =>
        @span class: 'function-name text-highlight inline-block', frame.functionName
        @span class: 'source-location text-info inline-block pull-right', =>
          @text "#{frame.path} @ #{frame.lineNumber}"
      @div class: 'panel-body padded', =>
        @pre output: 'source', 'Source goes here'

  initialize: (@frame) ->

module.exports =
  StacktraceView: StacktraceView
  FrameView: FrameView

{'fraction_non_alphanumeric': 0.1295296838858905, 'fraction_numerical': 0.0007710100231303007, 'mean_word_length': 3.138755980861244, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2730079', 'n_tokens_mistral': 778, 'n_tokens_neox': 755, 'n_words': 232}