<commit_before>package io.shiftleft.joern.console

import io.shiftleft.console.{Help, Run}

object Predefined {

  /* ammonite tab completion is partly broken for scala > 2.12.8
   * applying workaround for package wildcard imports from https://github.com/lihaoyi/Ammonite/issues/1009 */
  val shared: String = """
        |import io.shiftleft.console.{`package` => _, _}
        |import io.shiftleft.joern.console._
        |import io.shiftleft.joern.console.JoernConsole._
        |import io.shiftleft.codepropertygraph.Cpg
        |import io.shiftleft.codepropertygraph.cpgloading._
        |import io.shiftleft.codepropertygraph.generated._
        |import io.shiftleft.codepropertygraph.generated.nodes._
        |import io.shiftleft.codepropertygraph.generated.edges._
        |import io.shiftleft.dataflowengineoss.language.{`package` => _, _}
        |import io.shiftleft.semanticcpg.language.{`package` => _, _}
        |import overflowdb.{`package` => _, _}
        |import overflowdb.traversal.{`package` => _, help => _, _}
        |import scala.jdk.CollectionConverters._
        |implicit val resolver: ICallResolver = NoResolve
      """.stripMargin

  val forInteractiveShell: String =
    shared +
      """
        |import io.shiftleft.joern.console.Joern._
      """.stripMargin +
      dynamicPredef()

  val forScripts: String =
    shared +
      """
        |import io.shiftleft.joern.console.Joern.{cpg =>_, _}
      """.stripMargin +
      dynamicPredef()<commit_msg>Fix `.location` on joern shell<commit_after>package io.shiftleft.joern.console

import io.shiftleft.console.{Help, Run}

object Predefined {

  /* ammonite tab completion is partly broken for scala > 2.12.8
   * applying workaround for package wildcard imports from https://github.com/lihaoyi/Ammonite/issues/1009 */
  val shared: String = """
        |import io.shiftleft.console.{`package` => _, _}
        |import io.shiftleft.joern.console._
        |import io.shiftleft.joern.console.JoernConsole._
        |import io.shiftleft.codepropertygraph.Cpg
        |import io.shiftleft.codepropertygraph.cpgloading._
        |import io.shiftleft.codepropertygraph.generated._
        |import io.shiftleft.codepropertygraph.generated.nodes._
        |import io.shiftleft.codepropertygraph.generated.edges._
        |import io.shiftleft.dataflowengineoss.language.{`package` => _, _}
        |import io.shiftleft.semanticcpg.language.{`package` => _, _}
        |import overflowdb.{`package` => _, _}
        |import overflowdb.traversal.{`package` => _, help => _, _}
        |import scala.jdk.CollectionConverters._
        |implicit val resolver: ICallResolver = NoResolve
        |implicit val finder: NodeExtensionFinder = DefaultNodeExtensionFinder
      """.stripMargin

  val forInteractiveShell: String =
    shared +
      """
        |import io.shiftleft.joern.console.Joern._
      """.stripMargin +
      dynamicPredef()

  val forScripts: String =
    shared +
      """
        |import io.shiftleft.joern.console.Joern.{cpg =>_, _}
      """.stripMargin +
      dynamicPredef()
{'fraction_non_alphanumeric': 0.12012987012987013, 'fraction_numerical': 0.005194805194805195, 'mean_word_length': 2.9398976982097187, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 2, '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': '1116484', 'n_tokens_mistral': 944, 'n_tokens_neox': 952, 'n_words': 160}