diff --git a/presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala b/presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala index 03bb8d03d1db..a517df60e833 100644 --- a/presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala +++ b/presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala @@ -920,6 +920,7 @@ class Completions( v match case _: CompletionValue.SingletonValue => 0 case _: CompletionValue.Compiler => 1 + case CompletionValue.ExtraMethod(_, _: CompletionValue.Compiler) => 1 case _: CompletionValue.CaseKeyword => 2 case _: CompletionValue.NamedArg => 3 case _: CompletionValue.Keyword => 4 diff --git a/presentation-compiler/src/main/dotty/tools/pc/completions/SingletonCompletions.scala b/presentation-compiler/src/main/dotty/tools/pc/completions/SingletonCompletions.scala index 769f47114c98..6e59c9afca3a 100644 --- a/presentation-compiler/src/main/dotty/tools/pc/completions/SingletonCompletions.scala +++ b/presentation-compiler/src/main/dotty/tools/pc/completions/SingletonCompletions.scala @@ -32,7 +32,7 @@ object SingletonCompletions: case (i @ Ident(name)) :: _ => List(name.toString() -> i.span) case (l @ Literal(const)) :: _ => List(const.show -> l.span) case _ => Nil - query = name.replace(Cursor.value, "") + query = name.replace(Cursor.value, "").nn tpe = tpe0 match // for Tuple 2 we want to suggest first arg completion case AppliedType(t: TypeRef, args) if t.classSymbol == Symbols.defn.Tuple2 && args.nonEmpty => diff --git a/presentation-compiler/test/dotty/tools/pc/tests/PcReferencesSuite.scala b/presentation-compiler/test/dotty/tools/pc/tests/PcReferencesSuite.scala index aee3fd37617f..15ee35928872 100644 --- a/presentation-compiler/test/dotty/tools/pc/tests/PcReferencesSuite.scala +++ b/presentation-compiler/test/dotty/tools/pc/tests/PcReferencesSuite.scala @@ -1,12 +1,16 @@ package dotty.tools.pc.tests + +import scala.language.unsafeNulls + import dotty.tools.pc.base.BasePCSuite import dotty.tools.pc.utils.RangeReplace -import scala.meta.internal.pc.PcReferencesRequest -import scala.meta.internal.metals.CompilerVirtualFileParams + import java.net.URI -import scala.meta.internal.metals.EmptyCancelToken import org.eclipse.lsp4j.jsonrpc.messages.{Either => JEither} import scala.meta.internal.jdk.CollectionConverters.* +import scala.meta.internal.metals.CompilerVirtualFileParams +import scala.meta.internal.metals.EmptyCancelToken +import scala.meta.internal.pc.PcReferencesRequest import org.junit.Test