@@ -85,9 +85,9 @@ object Completion {
85
85
* @param content The source content that we'll check the positions for the prefix
86
86
* @param start The start position we'll start to look for the prefix at
87
87
* @param end The end position we'll look for the prefix at
88
- * @return Either the full prefix including the ` or an empty string
88
+ * @return Either the full prefix including the ` or an empty string
89
89
*/
90
- private def checkBacktickPrefix (content : Array [Char ], start : Int , end : Int ): String =
90
+ private def checkBacktickPrefix (content : Array [Char ], start : Int , end : Int ): String =
91
91
content.lift(start) match
92
92
case Some (char) if char == '`' =>
93
93
content.slice(start, end).mkString
@@ -111,7 +111,7 @@ object Completion {
111
111
// Foo.`se<TAB> will result in Select(Ident(Foo), <error>)
112
112
case (select : untpd.Select ) :: _ if select.name == nme.ERROR =>
113
113
checkBacktickPrefix(select.source.content(), select.nameSpan.start, select.span.end)
114
-
114
+
115
115
// import scala.util.chaining.`s<TAB> will result in a Ident(<error>)
116
116
case (ident : untpd.Ident ) :: _ if ident.name == nme.ERROR =>
117
117
checkBacktickPrefix(ident.source.content(), ident.span.start, ident.span.end)
@@ -177,14 +177,14 @@ object Completion {
177
177
// https://github.com/com-lihaoyi/Ammonite/blob/73a874173cd337f953a3edc9fb8cb96556638fdd/amm/util/src/main/scala/ammonite/util/Model.scala
178
178
private def needsBacktick (s : String ) =
179
179
val chunks = s.split(" _" , - 1 )
180
-
180
+
181
181
val validChunks = chunks.zipWithIndex.forall { case (chunk, index) =>
182
182
chunk.forall(Chars .isIdentifierPart) ||
183
183
(chunk.forall(Chars .isOperatorPart) &&
184
184
index == chunks.length - 1 &&
185
185
! (chunks.lift(index - 1 ).contains(" " ) && index - 1 == 0 ))
186
186
}
187
-
187
+
188
188
val validStart =
189
189
Chars .isIdentifierStart(s(0 )) || chunks(0 ).forall(Chars .isOperatorPart)
190
190
@@ -312,7 +312,7 @@ object Completion {
312
312
313
313
/** Replaces underlying type with reduced one, when it's MatchType */
314
314
def reduceUnderlyingMatchType (qual : Tree )(using Context ): Tree =
315
- qual.tpe.widen match
315
+ qual.tpe.widen match
316
316
case ctx.typer.MatchTypeInDisguise (mt) => qual.withType(mt)
317
317
case _ => qual
318
318
0 commit comments