File tree 3 files changed +15
-4
lines changed
compiler/src/dotty/tools/dotc/interactive
src/main/dotty/tools/pc/completions
test/dotty/tools/pc/tests/completion
3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -218,8 +218,8 @@ object Completion:
218
218
// Ignore synthetic select from `This` because in code it was `Ident`
219
219
// See example in dotty.tools.languageserver.CompletionTest.syntheticThis
220
220
case tpd.Select (qual @ tpd.This (_), _) :: _ if qual.span.isSynthetic => completer.scopeCompletions
221
- case tpd.Select (qual, _) :: _ if qual.typeOpt.hasSimpleKind => completer.selectionCompletions(qual)
222
- case tpd.Select (qual, _) :: _ => Map .empty
221
+ case tpd.Select (qual, _) :: _ if qual.typeOpt.hasSimpleKind => completer.selectionCompletions(qual)
222
+ case tpd.Select (qual, _) :: _ => Map .empty
223
223
case (tree : tpd.ImportOrExport ) :: _ => completer.directMemberCompletions(tree.expr)
224
224
case _ => completer.scopeCompletions
225
225
Original file line number Diff line number Diff line change @@ -99,9 +99,9 @@ class CompletionProvider(
99
99
* 4| $1$.sliding@@[Int](size, step)
100
100
*
101
101
*/
102
- if qual.symbol.is(Flags .Synthetic ) && qual.symbol.name.isInstanceOf [DerivedName ] =>
102
+ if qual.symbol.is(Flags .Synthetic ) && qual.span.isZeroExtent && qual. symbol.name.isInstanceOf [DerivedName ] =>
103
103
qual.symbol.defTree match
104
- case valdef : ValDef => Select (valdef.rhs, name) :: tail
104
+ case valdef : ValDef if ! valdef.rhs.isEmpty => Select (valdef.rhs, name) :: tail
105
105
case _ => tpdPath0
106
106
case _ => tpdPath0
107
107
Original file line number Diff line number Diff line change @@ -2168,3 +2168,14 @@ class CompletionSuite extends BaseCompletionSuite:
2168
2168
""" |build: Unit
2169
2169
|""" .stripMargin,
2170
2170
)
2171
+
2172
+ @ Test def i7191 =
2173
+ check(
2174
+ """ |val x = Some(3).map(_.@@)
2175
+ |""" .stripMargin,
2176
+ """ |!=(x: Byte): Boolean
2177
+ |!=(x: Char): Boolean
2178
+ |!=(x: Double): Boolean
2179
+ |""" .stripMargin,
2180
+ topLines = Some (3 )
2181
+ )
You can’t perform that action at this time.
0 commit comments