-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Try to extract name when backtick is missing #13369
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -887,4 +887,38 @@ class CompletionTest { | |
) | ||
) | ||
} | ||
|
||
@Test def wrongAnyMember: Unit = { | ||
code"""|import scala.util.chaining.`sc${m1} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be good to test some cases with more natural usages of backticks - if the name clashes with a keyword or contains spaces or would be normally disallowed for some other reason There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added some more test cases, let me know if you have any other ideas! |
||
|""".withSource | ||
.completion(m1, Set(("`scalaUtilChainingOps`",Method,"[A](a: A): scala.util.ChainingOps[A]"))) | ||
} | ||
|
||
@Test def importBackticked: Unit = { | ||
code"""|object O{ | ||
| val `extends` = "" | ||
|} | ||
|import O.`extends`${m1} | ||
|""".withSource | ||
.completion(m1, Set(("extends",Field,"String"))) | ||
} | ||
|
||
@Test def importBacktickedUnclosed: Unit = { | ||
code"""|object O{ | ||
| val `extends` = "" | ||
|} | ||
|import O.`extends${m1} | ||
|""".withSource | ||
.completion(m1, Set(("`extends`",Field,"String"))) | ||
} | ||
|
||
|
||
@Test def importBacktickedUnclosedSpace: Unit = { | ||
code"""|object O{ | ||
| val `extends ` = "" | ||
|} | ||
|import O.`extends ${m1} | ||
|""".withSource | ||
.completion(m1, Set(("`extends `",Field,"String"))) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't mean repeating the tests performed in
CompletionTest.scala
but rather directly reproducing the issue reported in #12514:Starting with a fresh REPL try invoking completion on
import scala.util.chaining.`s
and then onimport scala.util.chaining.`sc
inside the same session