<commit_before>{CompositeDisposable} = require('atom')

BottomPanel = require('./views/bottom-panel')
BottomContainer = require('./views/bottom-container')
BottomStatus = require('./views/bottom-status')
Message = require('./views/message')

class LinterViews
  constructor: (@linter) ->
    @state = @linter.state
    @subscriptions = new CompositeDisposable
    @messages = []
    @markers = new Map()
    @panel = new BottomPanel().prepare()
    @bottomContainer = new BottomContainer().prepare(@linter.state)
    @bottomBar = null
    @bubble = null
    @count = File: 0, Line: 0, Project: 0

    @subscriptions.add atom.config.observe('linter.underlineIssues', (underlineIssues) =>
      @underlineIssues = underlineIssues
    )
    @subscriptions.add atom.config.observe('linter.showErrorInline', (showBubble) =>
      @showBubble = showBubble
    )
    @subscriptions.add atom.config.observe('linter.showErrorPanel', (showPanel) =>
      @panel.panelVisibility = showPanel
    )
    @subscriptions.add atom.workspace.onDidChangeActivePaneItem (paneItem) =>
      isTextEditor = paneItem?.getPath?
      @bottomContainer.setVisibility(isTextEditor)
      @panel.panelVisibility = atom.config.get('linter.showErrorPanel') and isTextEditor
      @render(@linter.messages.publicMessages)
    @subscriptions.add @bottomContainer.onDidChangeTab =>
      @renderPanelMessages()

  render: ({added, removed, messages}) ->
    @messages = @classifyMessages(messages)
    @renderPanelMessages()<commit_msg>:bug: Fix tab change with the new struct<commit_after>{CompositeDisposable} = require('atom')

BottomPanel = require('./views/bottom-panel')
BottomContainer = require('./views/bottom-container')
BottomStatus = require('./views/bottom-status')
Message = require('./views/message')

class LinterViews
  constructor: (@linter) ->
    @state = @linter.state
    @subscriptions = new CompositeDisposable
    @messages = []
    @markers = new Map()
    @panel = new BottomPanel().prepare()
    @bottomContainer = new BottomContainer().prepare(@linter.state)
    @bottomBar = null
    @bubble = null
    @count = File: 0, Line: 0, Project: 0

    @subscriptions.add atom.config.observe('linter.underlineIssues', (underlineIssues) =>
      @underlineIssues = underlineIssues
    )
    @subscriptions.add atom.config.observe('linter.showErrorInline', (showBubble) =>
      @showBubble = showBubble
    )
    @subscriptions.add atom.config.observe('linter.showErrorPanel', (showPanel) =>
      @panel.panelVisibility = showPanel
    )
    @subscriptions.add atom.workspace.onDidChangeActivePaneItem (paneItem) =>
      isTextEditor = paneItem?.getPath?
      @bottomContainer.setVisibility(isTextEditor)
      @panel.panelVisibility = atom.config.get('linter.showErrorPanel') and isTextEditor
      @render({added: [], removed: [], messages: @linter.messages.publicMessages})
    @subscriptions.add @bottomContainer.onDidChangeTab =>
      @renderPanelMessages()

  render: ({added, removed, messages}) ->
    @messages = @classifyMessages(messages)
    @renderPanelMessages()
{'fraction_non_alphanumeric': 0.13391984359726294, 'fraction_numerical': 0.0019550342130987292, 'mean_word_length': 4.265866209262436, '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': '6238657', 'n_tokens_mistral': 906, 'n_tokens_neox': 887, 'n_words': 161}