scalameta / metals

Scala language server with rich IDE features 🚀
https://scalameta.org/metals/
Apache License 2.0
2.07k stars 325 forks source link

Scala 3: Completions, HOFs and aliased tuple types #6613

Open kubukoz opened 1 month ago

kubukoz commented 1 month ago

Describe the bug

To reproduce:

  1. Write this
    
    //> using scala 3.5.0-RC5
    trait Foo {
    def setup: List[Foo.Result]
    }

object Foo { type Result = (String, String)

def demo(foo: Foo) = { foo.setup.map }

}



2. Get completions at `<cursor>`
3. See this:

![Uploading image.png…]()

### Expected behavior

- No parenthesis around `Result`
- Wouldn't mind seeing the type alias's enclosing type name (`Foo.Result`) like in Scala 2

<img width="612" alt="image" src="https://github.com/user-attachments/assets/89489689-efa7-41a0-802a-5f40810649ab">

### Operating system

macOS

### Editor/Extension

VS Code

### Version of Metals

v1.3.3

### Extra context or search terms

- This is a really minor issue, arguably a cosmetic
- Opaque types don't have the parenthesis
tgodzik commented 1 month ago

Thanks for reporting! Looks like the first picture didn't upload, but I guess this about the added () around Foo.Result?

The type alias changes might have not been ported yet to Scala 3 repo.

kubukoz commented 1 month ago

Yes, sorry, I didn't notice after posting 😅 the completion in Scala 3 shows "(Result)" where 2.13 shows "Foo.Result".