Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scala 3 extension methods autocompletion shortcomings #1297

Open
mpollmeier opened this issue Oct 7, 2022 · 0 comments
Open

Scala 3 extension methods autocompletion shortcomings #1297

mpollmeier opened this issue Oct 7, 2022 · 0 comments

Comments

@mpollmeier
Copy link
Contributor

Autocompletion for Scala 3 extension methods currently has many shortcomings. Here's the status quo of what works and doesn't work with Scala 3.2.0.

Starting with the good: the following works, if you paste it as one block into amm:

class A
extension (a: A)
  def foobarbaz: Int = 42
val a = new A
// paste everything above as one block

a.foo<tab> // completes fine

Issue 1: if you paste the same in two blocks, autocompletion doesn't work any longer:

class A
// submit the above line first!

extension (a: A)
  def foobarbaz: Int = 42
val a = new A
a.foo<tab>  // doesn't autocomplete :(
a.foobarbaz // compiles fine though...

Issue 2: the parser doesn't support curly braces

class A
extension (a: A) {
  def foobarbaz: Int = 42
}
val a = new A
a.foo<tab>  // doesn't autocomplete :(
a.foobarbaz // compiles fine though...

Issue 3: importing them from a different namespace doesn't work either:

class A
object AExt:
  extension (a: A)
    def foobarbaz: Int = 42
import AExt.foobarbaz
val a = new A

a.foo<tab>  // doesn't autocomplete :(
a.foobarbaz // compiles fine though...

All of the above work in the regular scala 3.2.0 repl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant