File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed
compiler/src/dotty/tools/dotc/interactive
src/main/dotty/tools/pc/completions
test/dotty/tools/pc/tests/completion Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -332,7 +332,7 @@ object Completion:
332
332
(sym.companionClass.exists && sym.companionClass.is(Enum ))
333
333
334
334
sym.exists &&
335
- ! sym.isAbsent() &&
335
+ ! sym.isAbsent(canForce = false ) &&
336
336
! sym.isPrimaryConstructor &&
337
337
sym.sourceSymbol.exists &&
338
338
(! sym.is(Package ) || sym.is(ModuleClass )) &&
Original file line number Diff line number Diff line change @@ -590,7 +590,7 @@ class Completions(
590
590
else false ,
591
591
)
592
592
Some (search.search(query, buildTargetIdentifier, visitor).nn)
593
- else if completionMode.is(Mode .Member ) then
593
+ else if completionMode.is(Mode .Member ) && query.nonEmpty then
594
594
val visitor = new CompilerSearchVisitor (sym =>
595
595
def isExtensionMethod = sym.is(ExtensionMethod ) &&
596
596
qualType.widenDealias <:< sym.extensionParam.info.widenDealias
Original file line number Diff line number Diff line change @@ -228,6 +228,10 @@ class CompletionExtensionSuite extends BaseCompletionSuite:
228
228
|""" .stripMargin
229
229
)
230
230
231
+ /**
232
+ * For optimization, we don't show any completions here as it would bring
233
+ * every extension method into the completion list.
234
+ */
231
235
@ Test def `simple-empty` =
232
236
check(
233
237
""" |package example
@@ -238,11 +242,13 @@ class CompletionExtensionSuite extends BaseCompletionSuite:
238
242
|
239
243
|def main = 100.@@
240
244
|""" .stripMargin,
241
- """ |incr: Int (extension)
242
- |""" .stripMargin,
245
+ " " ,
243
246
filter = _.contains(" (extension)" )
244
247
)
245
248
249
+ /**
250
+ * Some as above, but for implicit completions.
251
+ */
246
252
@ Test def `simple-empty-old` =
247
253
check(
248
254
""" |package example
@@ -253,8 +259,7 @@ class CompletionExtensionSuite extends BaseCompletionSuite:
253
259
|
254
260
|def main = 100.@@
255
261
|""" .stripMargin,
256
- """ |testOps(b: Int): String (implicit)
257
- |""" .stripMargin,
262
+ " " ,
258
263
filter = _.contains(" (implicit)" )
259
264
)
260
265
You can’t perform that action at this time.
0 commit comments