Skip to content

Draft: additional completions for using clause #23647

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vder
Copy link

@vder vder commented Aug 1, 2025

fix for #22939

@vder
Copy link
Author

vder commented Aug 1, 2025

I've added some additional tests that are failing currently:

  1. using2 - duplicates using
  2. using3 - adds using to the last argument ()

@vder
Copy link
Author

vder commented Aug 1, 2025

Scala CLA signed

|@main def main1(): Unit =
| val str = "hello"
| val int = 4
| hello(using str, int)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this check is actually failing because we check if arguments.size == 1

I would leave this test out or just document the current behaviour.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah the test was written this way as this was one of the proposed solutions to do nothing when we have 2 arguments. When I remove that guard the using keyword will be before int arg anyway. I'm not sure should i leave it that way or try to fix it.

s"""|def hello(using String): Unit = ???
|@main def main1(): Unit =
| val str = "hello"
| hello(using str)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this one is adding two usings still, do you need help figuring this one out?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup some hints will be welcomed :). As far as I understand it the completion check is done from method invocation level, but I'm not sure how could I check the actual code or find out if there already i s'using' clause in any other way.

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

Successfully merging this pull request may close these issues.

2 participants