Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -734,15 +734,18 @@ class Completions(
defn.Object_notifyAll,
defn.Object_notify,
defn.Predef_undefined,
defn.ObjectClass.info.member(nme.wait_).symbol,
// NOTE(olafur) IntelliJ does not complete the root package and without this filter
// then `_root_` would appear as a completion result in the code `foobar(_<COMPLETE>)`
defn.RootPackage,
// NOTE(gabro) valueOf was added as a Predef member in 2.13. We filter it out since is a niche
// use case and it would appear upon typing 'val'
defn.ValueOfClass.info.member(nme.valueOf).symbol,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ValueOf.valueOf does not exist and going by the comment, it seems that the ValueOf class was meant to be filtered here instead, so I changed this.

defn.ScalaPredefModule.requiredMethod(nme.valueOf)
).flatMap(_.alternatives.map(_.symbol)).toSet
defn.ValueOfClass
) ++ (
Set(
defn.ObjectClass.info.member(nme.wait_),
defn.ScalaPredefModule.info.member(nme.valueOf)
).flatMap(_.alternatives.map(_.symbol)).toSet
)

private def isNotLocalForwardReference(sym: Symbol)(using Context): Boolean =
!sym.isLocalToBlock ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,6 @@ class CompletionSuite extends BaseCompletionSuite:
|isInstanceOf[X0]: Boolean
|synchronized[X0](x$0: X0): X0
|toString(): String
|wait(): Unit
|wait(x$0: Long): Unit
|wait(x$0: Long, x$1: Int): Unit
|""".stripMargin
)

Expand Down
Loading