Skip to content

Commit 88eab4c

Browse files
author
Piotr Fałdrowicz
committed
adjustments after CR
1 parent 78b6dbd commit 88eab4c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

presentation-compiler/src/main/dotty/tools/pc/completions/Completions.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,10 @@ class Completions(
202202
}
203203
.chain{ suffix =>
204204
adjustedPath match
205-
case (ident: Ident) :: (app@Apply(_,args)) :: _ if args.size == 1 =>
205+
case (ident: Ident) :: (app@Apply(_, List(arg))) :: _ =>
206206
app.symbol.info match
207-
case mt@MethodType(termNames) if app.symbol.paramSymss.last.exists(_.is(Given)) =>
207+
case mt@MethodType(termNames) if app.symbol.paramSymss.last.exists(_.is(Given)) &&
208+
!text.substring(app.fun.span.start, arg.span.end).contains("using") =>
208209
suffix.withNewPrefix(Affix(PrefixKind.Using))
209210
case _ => suffix
210211
case _ => suffix

presentation-compiler/test/dotty/tools/pc/tests/completion/CompletionArgSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ class CompletionArgSuite extends BaseCompletionSuite:
278278
|@main def main1(): Unit =
279279
| val str = "hello"
280280
| val int = 4
281-
| hello(using str, int)
281+
| hello(str, int)
282282
|""".stripMargin,
283283
assertSingleItem = false)
284284

0 commit comments

Comments
 (0)