<commit_before>AnnotationOverlayView = require './annotation-overlay-view'

module.exports =
class AnnotationManager
  constructor: (@levelCodeEditor) ->
    @textEditor = @levelCodeEditor.getTextEditor()
    @textEditorSubscriptionsByExecutionIssueId = {}
    @markersByExecutionIssueId = {}

  addAnnotationForExecutionIssue: (executionIssue) ->
    type = executionIssue.getType()
    source = executionIssue.getSource()
    row = parseInt(executionIssue.getRow()) - 1
    col = parseInt(executionIssue.getColumn() ? 0) - 1
    message = executionIssue.getMessage()

    marker = @textEditor.markBufferRange [[row, col], [row, Infinity]], invalidate: 'inside'
    @markersByExecutionIssueId[executionIssue.getId()] = marker

    @textEditor.decorateMarker marker, {type: 'line-number', class: "annotation annotation-#{type}"}

    annotationOverlayView = new AnnotationOverlayView {type, source, row, col, message}
    @textEditor.decorateMarker marker, {type: 'overlay', item: annotationOverlayView, position: 'tail'}

    if @textEditor.getCursorBufferPosition().row == row
      annotationOverlayView.show()
    else
      annotationOverlayView.hide()

    @textEditorSubscriptionsByExecutionIssueId[executionIssue.getId()] = @textEditor.onDidChangeCursorPosition (event) ->
      if event.newBufferPosition.row == row
        annotationOverlayView.show()
      else
        annotationOverlayView.hide()

  removeAnnotationForExecutionIssue: (executionIssue) ->
    executionIssueId = executionIssue.getId()
    @textEditorSubscriptionsByExecutionIssueId[executionIssueId].dispose()
    delete @textEditorSubscriptionsByExecutionIssueId[executionIssueId]
    @markersByExecutionIssueId[executionIssueId].destroy()
    delete @markersByExecutionIssueId[executionIssueId]<commit_msg>Added missing return statements to the annotation manager module<commit_after>AnnotationOverlayView = require './annotation-overlay-view'

module.exports =
class AnnotationManager
  constructor: (@levelCodeEditor) ->
    @textEditor = @levelCodeEditor.getTextEditor()
    @textEditorSubscriptionsByExecutionIssueId = {}
    @markersByExecutionIssueId = {}

  addAnnotationForExecutionIssue: (executionIssue) ->
    type = executionIssue.getType()
    source = executionIssue.getSource()
    row = parseInt(executionIssue.getRow()) - 1
    col = parseInt(executionIssue.getColumn() ? 0) - 1
    message = executionIssue.getMessage()

    marker = @textEditor.markBufferRange [[row, col], [row, Infinity]], invalidate: 'inside'
    @markersByExecutionIssueId[executionIssue.getId()] = marker

    @textEditor.decorateMarker marker, {type: 'line-number', class: "annotation annotation-#{type}"}

    annotationOverlayView = new AnnotationOverlayView {type, source, row, col, message}
    @textEditor.decorateMarker marker, {type: 'overlay', item: annotationOverlayView, position: 'tail'}

    if @textEditor.getCursorBufferPosition().row == row
      annotationOverlayView.show()
    else
      annotationOverlayView.hide()

    @textEditorSubscriptionsByExecutionIssueId[executionIssue.getId()] = @textEditor.onDidChangeCursorPosition (event) ->
      if event.newBufferPosition.row == row
        annotationOverlayView.show()
      else
        annotationOverlayView.hide()

    return

  removeAnnotationForExecutionIssue: (executionIssue) ->
    executionIssueId = executionIssue.getId()
    @textEditorSubscriptionsByExecutionIssueId[executionIssueId].dispose()
    delete @textEditorSubscriptionsByExecutionIssueId[executionIssueId]
    @markersByExecutionIssueId[executionIssueId].destroy()
    delete @markersByExecutionIssueId[executionIssueId]

    return
{'fraction_non_alphanumeric': 0.10304192929569746, 'fraction_numerical': 0.001644286105782406, 'mean_word_length': 5.196943972835314, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '6174983', 'n_tokens_mistral': 1047, 'n_tokens_neox': 973, 'n_words': 179}