Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Contribute candidates when the selection is a Select
  • Loading branch information
natsukagami committed May 20, 2024
commit a399946afe0977e275e77d44283790eaf982072a
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,20 @@ class Completions(
),
false,
)
case Select(_, name) :: (unapp : UnApply) :: _ =>
(
CaseKeywordCompletion.contribute(
EmptyTree, // no selector
completionPos,
indexedContext,
config,
search,
parent = unapp,
autoImports,
patternOnly = Some(name.decoded)
),
false,
)

// class FooImpl extends Foo:
// def x|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ object CaseKeywordCompletion:
val argPts = UnapplyArgs(fn.tpe.widen.finalResultType, fn, patterns, parent.srcPos).argTypes
patterns.zipWithIndex
.find:
case (id@Ident(v), tpe) => v.decoded == value
case _ => false
case (Ident(v), tpe) => v.decoded == value
case (Select(_, v), tpe) => v.decoded == value
case t => false
.map((_, id) => argPts(id).widen.deepDealias)
/* Parent is a function expecting a case match expression */
case TreeApply(fun, _) if !fun.tpe.isErroneous =>
Expand Down