Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
alexarchambault committed May 31, 2024
1 parent 4806e0e commit ea6b363
Showing 1 changed file with 32 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,38 @@ object ScalaInterpreterCompletions {

private def newLine = System.lineSeparator()

private val blacklist = {
val scalaList = Seq(
"Predef.any2stringadd.+",
"Any.##",
"<byname>",
"<empty>",
"<repeated>",
"<repeated...>",
"Predef.StringFormat.formatted",
"Predef.Ensuring.ensuring",
"Predef.ArrowAssoc.->",
"Predef.ArrowAssoc.→"
)
val javaLangList = Set(
"Object.##",
"Object.synchronized",
"Object.ne",
"Object.eq",
"Object.wait",
"Object.notifyAll",
"Object.notify",
"Object.clone",
"Object.finalize"
)
val it =
Iterator("", "scala.")
.flatMap(prefix => scalaList.iterator.map(prefix + _)) ++
Iterator("", "java.lang.")
.flatMap(prefix => javaLangList.iterator.map(prefix + _))
it.toSet
}

def complete(
compilerManager: ammonite.compiler.iface.CompilerLifecycleManager,
dependencyCompleteOpt: Option[String => (Int, Seq[String])],
Expand Down Expand Up @@ -108,27 +140,6 @@ object ScalaInterpreterCompletions {

def blacklisted(s: Symbol) = {
given Context = ctx1
val blacklist = Set(
"scala.Predef.any2stringadd.+",
"scala.Any.##",
"java.lang.Object.##",
"scala.<byname>",
"scala.<empty>",
"scala.<repeated>",
"scala.<repeated...>",
"scala.Predef.StringFormat.formatted",
"scala.Predef.Ensuring.ensuring",
"scala.Predef.ArrowAssoc.->",
"scala.Predef.ArrowAssoc.→",
"java.lang.Object.synchronized",
"java.lang.Object.ne",
"java.lang.Object.eq",
"java.lang.Object.wait",
"java.lang.Object.notifyAll",
"java.lang.Object.notify",
"java.lang.Object.clone",
"java.lang.Object.finalize"
)

blacklist(s.showFullName) ||
s.isOneOf(Flags.GivenOrImplicit) ||
Expand Down

0 comments on commit ea6b363

Please sign in to comment.