Skip to content

Commit

Permalink
deal with unsafe nulls and fix sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiaMarek committed Jul 25, 2024
1 parent 3b3b8a7 commit 637b1d3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =>
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 637b1d3

Please sign in to comment.