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 range selection follow up #6569

Open
Quafadas opened this issue Jul 8, 2024 · 0 comments
Open

Scala 3 range selection follow up #6569

Quafadas opened this issue Jul 8, 2024 · 0 comments
Labels
improvement Not a bug or a feature, but something general we can improve Scala 3 Generic ticket relating to Scala 3

Comments

@Quafadas
Copy link
Contributor

Quafadas commented Jul 8, 2024

Describe the bug

This PR #6485 started with the grand aim, of addressing #6568, #6485 ultimately took only the first step as a blind back port from the scala 3 presentation compiler. I don't believe the compiler implementation to be perfect - this test fails;

  check(
    "def - braced",
    """object Main extends App { def foo(hi: Int, b@@: Int, c:Int) = ??? } """.stripMargin,
    List(),
    Map(
      "3" -> List(
        """object Main extends App { def foo(hi: Int, >>region>>b: Int<<region<<, c:Int) = ??? }""".stripMargin,
        """object Main extends App { def foo(>>region>>hi: Int, b: Int, c:Int<<region<<) = ??? }""".stripMargin,
        """object Main extends App { >>region>>def foo(hi: Int, b: Int, c:Int) = ???<<region<< }""".stripMargin,
        /* These fail. A perfect implemenation would succeed (I believe). The effort / fix value ratio means we leave it as is for now */
        """object Main extends >>region>>App { def foo(hi: Int, b: Int, c:Int) = ??? }<<region<<""".stripMargin,
        """>>region>>object Main extends App { def foo(hi: Int, b: Int, c:Int) = ??? }<<region<<""".stripMargin
      )
    )
  )

Where I believe it should succeed. Should #6485 get merged, it will be without the lines below the comment. It is left as such as the effort / value ratio is rather high, but recorded here for posterity.

Expected behavior

The test in def -braced test in SelectionRangeSuite.scala should pass with the extra lines above.

Operating system

macOS

Editor/Extension

VS Code

Version of Metals

v.1.3.2

Extra context or search terms

No response

@tgodzik tgodzik added improvement Not a bug or a feature, but something general we can improve Scala 3 Generic ticket relating to Scala 3 labels Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Not a bug or a feature, but something general we can improve Scala 3 Generic ticket relating to Scala 3
Projects
None yet
Development

No branches or pull requests

2 participants