<commit_before>import * as React from 'react'
import { IAutocompletionProvider } from './index'
import { IssuesStore } from '../../lib/dispatcher'
import { GitHubRepository } from '../../models/github-repository'

export interface IIssueHit {
  readonly title: string
  readonly number: string
}

export class IssuesAutocompletionProvider implements IAutocompletionProvider<IIssueHit> {
  private readonly issuesStore: IssuesStore
  private readonly repository: GitHubRepository

  public constructor(issuesStore: IssuesStore, repository: GitHubRepository) {
    this.issuesStore = issuesStore
    this.repository = repository
  }

  public getRegExp(): RegExp {
    return /(?:^|\n| )(?:#)([a-z0-9\\+\\-][a-z0-9_]*)?/g
  }

  public getAutocompletionItems(text: string): Promise<ReadonlyArray<IIssueHit>> {
    return this.issuesStore.getIssuesMatching(this.repository, text)
  }

  public renderItem(item: IIssueHit): JSX.Element {
    return (
      <div className='issue' key={item.number}>
        <span className='number'>#{item.number}</span>
        <span className='title'>{item.title}</span>
      </div>
    )
  }

  public getCompletionText(item: IIssueHit): string {
    return `#${item.number}`
  }
}
<commit_msg>:book:<commit_after>import * as React from 'react'
import { IAutocompletionProvider } from './index'
import { IssuesStore } from '../../lib/dispatcher'
import { GitHubRepository } from '../../models/github-repository'

/** An autocompletion hit for an issue. */
export interface IIssueHit {
  /** The title of the issue. */
  readonly title: string

  /** The issue's number. */
  readonly number: string
}

/** The autocompletion provider for issues in a GitHub repository. */
export class IssuesAutocompletionProvider implements IAutocompletionProvider<IIssueHit> {
  private readonly issuesStore: IssuesStore
  private readonly repository: GitHubRepository

  public constructor(issuesStore: IssuesStore, repository: GitHubRepository) {
    this.issuesStore = issuesStore
    this.repository = repository
  }

  public getRegExp(): RegExp {
    return /(?:^|\n| )(?:#)([a-z0-9\\+\\-][a-z0-9_]*)?/g
  }

  public getAutocompletionItems(text: string): Promise<ReadonlyArray<IIssueHit>> {
    return this.issuesStore.getIssuesMatching(this.repository, text)
  }

  public renderItem(item: IIssueHit): JSX.Element {
    return (
      <div className='issue' key={item.number}>
        <span className='number'>#{item.number}</span>
        <span className='title'>{item.title}</span>
      </div>
    )
  }

  public getCompletionText(item: IIssueHit): string {
    return `#${item.number}`
  }
}

{'fraction_non_alphanumeric': 0.1376286694624476, 'fraction_numerical': 0.0030499428135722455, 'mean_word_length': 3.998095238095238, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '3520486', 'n_tokens_mistral': 797, 'n_tokens_neox': 775, 'n_words': 183}