<commit_before># require "../spec-helper"
# {$, EditorView, WorkspaceView} = require 'atom'
# AutocompleteView = require '../../lib/autocomplete-view'
# Autocomplete = require '../../lib/autocomplete'

# describe "Autocomplete", ->
#   [activationPromise, autocomplete, completionDelay] = []
#   [leftPaneView, rightPaneView] = []
#   [leftEditor, rightEditor] = []
#   [leftEditorView, rightEditorView] = []
#   [leftAutocomplete, rightAutocomplete] = []

#   describe "Issue 50", ->
#     beforeEach ->
#       # Create a fake workspace and open a sample file
#       atom.workspaceView = new WorkspaceView
#       atom.workspaceView.openSync "sample.js"
#       atom.workspaceView.simulateDomAttachment()

#       # Set to live completion
#       atom.config.set "autocomplete-plus.enableAutoActivation", true

#       # Set the completion delay
#       completionDelay = 100
#       atom.config.set "autocomplete-plus.autoActivationDelay", completionDelay
#       completionDelay += 100 # Rendering delay

#       # Activate the package
#       activationPromise = atom.packages.activatePackage "autocomplete-plus"

#       leftPaneView = atom.workspaceView.getActivePaneView()
#       rightPaneView = leftPaneView.splitRight(leftPaneView.copyActiveItem())

#       [leftEditorView, rightEditorView] = atom.workspaceView.getEditorViews()
#       leftEditor = leftEditorView.editor
#       rightEditor = rightEditorView.editor

#       leftAutocomplete = new AutocompleteView leftEditorView
#       rightAutocomplete = new AutocompleteView rightEditorView

#     describe "when splitting the view and closing it", ->
#       it "does not throw an error when triggering autocompletion", ->
#         waitsForPromise ->
#           activationPromise

#         runs ->
#           leftEditorView.attachToDom()
#           rightEditorView.attachToDom()

#           leftEditor.moveCursorToBottom()
#           leftEditor.insertText "c"

#           advanceClock completionDelay

#           expect(leftEditorView.find(".autocomplete-plus")).toExist()

#           # This fails, even though in atom, it works...
#           expect(rightEditorView.find(".autocomplete-plus")).toExist()<commit_msg>Tried to fix specs for #50<commit_after># require "../spec-helper"
# {$, EditorView, WorkspaceView} = require 'atom'
# AutocompleteView = require '../../lib/autocomplete-view'
# Autocomplete = require '../../lib/autocomplete'

# describe "Autocomplete", ->
#   [activationPromise, autocomplete, completionDelay] = []
#   [leftPaneView, rightPaneView] = []
#   [leftEditor, rightEditor] = []
#   [leftEditorView, rightEditorView] = []
#   [leftAutocomplete, rightAutocomplete] = []

#   describe "Issue 50", ->
#     beforeEach ->
#       # Create a fake workspace and open a sample file
#       atom.workspaceView = new WorkspaceView
#       atom.workspaceView.openSync "sample.js"
#       atom.workspaceView.simulateDomAttachment()

#       # Set to live completion
#       atom.config.set "autocomplete-plus.enableAutoActivation", true

#       # Set the completion delay
#       completionDelay = 100
#       atom.config.set "autocomplete-plus.autoActivationDelay", completionDelay
#       completionDelay += 100 # Rendering delay

#       # Activate the package
#       activationPromise = atom.packages.activatePackage "autocomplete-plus"

#       leftPaneView = atom.workspaceView.getActivePaneView()
#       rightPaneView = leftPaneView.splitRight(leftPaneView.copyActiveItem())

#       [leftEditorView, rightEditorView] = atom.workspaceView.getEditorViews()
#       leftEditor = leftEditorView.editor
#       rightEditor = rightEditorView.editor

#       leftAutocomplete = new AutocompleteView leftEditorView
#       rightAutocomplete = new AutocompleteView rightEditorView

#     describe "when splitting the view and closing it", ->
#       it "does not throw an error when triggering autocompletion", ->
#         waitsForPromise ->
#           activationPromise

#         runs ->
#           leftEditorView.attachToDom()
#           rightEditorView.attachToDom()

#           leftEditor.moveCursorToBottom()
#           leftEditor.insertText "c"

#           advanceClock completionDelay

#           expect(leftEditorView.find(".autocomplete-plus")).toExist()

#           rightEditorView.trigger "pane:close"

#           leftEditor.moveCursorToBottom()
#           leftEditor.insertText "c"
{'fraction_non_alphanumeric': 0.11037928684987508, 'fraction_numerical': 0.004088121735180559, 'mean_word_length': 3.0967441860465117, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '6857089', 'n_tokens_mistral': 1250, 'n_tokens_neox': 1200, 'n_words': 254}