File tree Expand file tree Collapse file tree 2 files changed +24
-5
lines changed
src/dotty/tools/dotc/interactive
test/dotty/tools/dotc/interactive Expand file tree Collapse file tree 2 files changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -114,11 +114,12 @@ object Completion {
114
114
val completions = path match {
115
115
// Ignore synthetic select from `This` because in code it was `Ident`
116
116
// See example in dotty.tools.languageserver.CompletionTest.syntheticThis
117
- case Select (qual @ This (_), _) :: _ if qual.span.isSynthetic => completer.scopeCompletions
118
- case Select (qual, _) :: _ => completer.selectionCompletions(qual)
119
- case Import (expr, _) :: _ => completer.directMemberCompletions(expr)
120
- case (_ : untpd.ImportSelector ) :: Import (expr, _) :: _ => completer.directMemberCompletions(expr)
121
- case _ => completer.scopeCompletions
117
+ case Select (qual @ This (_), _) :: _ if qual.span.isSynthetic => completer.scopeCompletions
118
+ case Select (qual, _) :: _ if ! qual.tpe.hasSimpleKind => Map .empty
119
+ case Select (qual, _) :: _ => completer.selectionCompletions(qual)
120
+ case Import (expr, _) :: _ => completer.directMemberCompletions(expr)
121
+ case (_ : untpd.ImportSelector ) :: Import (expr, _) :: _ => completer.directMemberCompletions(expr)
122
+ case _ => completer.scopeCompletions
122
123
}
123
124
124
125
val describedCompletions = describeCompletions(completions)
Original file line number Diff line number Diff line change @@ -169,3 +169,21 @@ class CustomCompletionTests extends DottyTest:
169
169
170
170
assert(offset == prefix.length)
171
171
assert(labels.contains(" scala.Function2" ))
172
+
173
+ @ Test def i12465_hkt (): Unit =
174
+ val prefix = " ???.asInstanceOf[scala.collection.Seq]"
175
+ val input = prefix + " ."
176
+
177
+ val (offset, completions0) = completions(input)
178
+ val labels = completions0.map(_.label)
179
+
180
+ assert(labels.isEmpty)
181
+
182
+ @ Test def i12465_hkt_alias (): Unit =
183
+ val prefix = " ???.asInstanceOf[Seq]"
184
+ val input = prefix + " ."
185
+
186
+ val (offset, completions0) = completions(input)
187
+ val labels = completions0.map(_.label)
188
+
189
+ assert(labels.isEmpty)
You can’t perform that action at this time.
0 commit comments