<commit_before>package analyzer

import scala.language.implicitConversions

import dotty.tools.dotc._
import core._
import Contexts.Context
import plugins._
import Phases.Phase
import ast.tpd
import transform.MegaPhase.MiniPhase
import Decorators._
import Symbols.Symbol
import Constants.Constant
import Types._
import transform.{CheckStatic}

class InitPlugin extends StandardPlugin {
  import tpd._
  val name: String = "initPlugin"
  override val description: String = "checks that under -Yretain-trees we may get tree for all symbols"

  def init(options: List[String]): List[PluginPhase] =
    (new SetDefTree) :: (new InitChecker) :: Nil
}

class InitChecker extends PluginPhase {
  import tpd._

  val phaseName = "symbolTreeChecker"

  override val runsAfter = Set(SetDefTree.name)
  override val runsBefore = Set(CheckStatic.name)

  private def checkDef(tree: Tree)(implicit ctx: Context): Tree = {
    if (tree.symbol.defTree.isEmpty)
      ctx.error("cannot get tree for " + tree.show, tree.sourcePos)
    tree
  }<commit_msg>Fix analyzer-plugin scripted test<commit_after>package analyzer

import scala.language.implicitConversions

import dotty.tools.dotc._
import core._
import Contexts.Context
import plugins._
import Phases.Phase
import ast.tpd
import transform.MegaPhase.MiniPhase
import Decorators._
import Symbols.Symbol
import Constants.Constant
import Types._
import transform.CompleteJavaEnums

class InitPlugin extends StandardPlugin {
  import tpd._
  val name: String = "initPlugin"
  override val description: String = "checks that under -Yretain-trees we may get tree for all symbols"

  def init(options: List[String]): List[PluginPhase] =
    (new SetDefTree) :: (new InitChecker) :: Nil
}

class InitChecker extends PluginPhase {
  import tpd._

  val phaseName = "symbolTreeChecker"

  override val runsAfter = Set(SetDefTree.name)
  override val runsBefore = Set(CompleteJavaEnums.name)

  private def checkDef(tree: Tree)(implicit ctx: Context): Tree = {
    if (tree.symbol.defTree.isEmpty)
      ctx.error("cannot get tree for " + tree.show, tree.sourcePos)
    tree
  }
{'fraction_non_alphanumeric': 0.08404558404558404, 'fraction_numerical': 0.0, 'mean_word_length': 4.618666666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6647626', 'n_tokens_mistral': 636, 'n_tokens_neox': 617, 'n_words': 193}