Skip to content

Named tuples: completions don't suggest labels if one is already present #7764

@kubukoz

Description

@kubukoz
//> using scala 3.7.3-RC2

type Item = (name: String, s: String)

def handle2(item: Item) =
  item.@@name

def handle3(item: (name: String, s: String)) =
  item.@@name
  1. Put the cursor on either of the @@s and try to invoke completions. Neither name nor s will show up. Instead, you'll see an item for item: (name: String), which results in invalid code (item.itemname or item.names respectively). Similar things happen in further characters of the token, except item stops appearing later.

Expected behaviour:

Both name and s get suggested

Operating system:
Mac OS X

Java version:
21.0.4

Editor/extension:
Visual Studio Code v1.95.2

Metals version:
1.6.2

Extra context or search terms:

Workspace information:

  • Scala versions: 3.7.3-RC2
  • Build tools: scala-cli
  • Build servers: scala-cli v1.8.5
  • All build tools in workspace:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Scala 3Generic ticket relating to Scala 3bugSomething that is making a piece of functionality unusablecompletionsTickets related to completion functionalityspree

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions