Skip to content

Commit

Permalink
fix match error in keyword completions
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiaMarek committed Dec 4, 2024
1 parent 6a08590 commit 115de9d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ object KeywordsCompletions:
case untpd.TypeDef(_, template: Template) => checkForPossibleKeywords(template)
case untpd.ModuleDef(_, template: Template) => checkForPossibleKeywords(template)
case template: Template => checkForPossibleKeywords(template)
case _ => TemplateKeywordAvailability.default
}.getOrElse(TemplateKeywordAvailability.default)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2150,3 +2150,21 @@ class CompletionSuite extends BaseCompletionSuite:
|""".stripMargin,
assertSingleItem = false
)

@Test def `metals-i6861` =
check(
"""|trait Builder[Alg]:
| def withTraces: String
|
|trait BuilderFactory:
| def transformRouter(f: [Alg] => Builder[Alg] => String): BuilderFactory
| def build: Unit
|
|def demo =
| (??? : BuilderFactory)
| .transformRouter([Alg] => _.withTraces)
| .build@@
|""".stripMargin,
"""|build: Unit
|""".stripMargin,
)

0 comments on commit 115de9d

Please sign in to comment.