-
Notifications
You must be signed in to change notification settings - Fork 21
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
JLine 3: Support camel-cased, acronym-style completion as previously #12267
Comments
@retronym at scala/scala#8036 (comment) :
|
It seems camelCase completers would be a sensible feature for JLine upstream? from jline/jline3#147
Then
Not sure if this ever happened |
Updated (and stable) link to the relevant part of the JLIne implenentation: https://github.com/jline/jline3/blob/2327d649ceb1bc8b4a4452b7821f1f0050503bc5/reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java#L4434-L4477 |
@SethTisue Here's a sketch of how I think JLine could be customized: https://github.com/retronym/jline3/pull/1/files |
removed from CompletionTest.scala for now: @Test
def camelCompletions(): Unit = {
val completer = setup()
checkExact(completer, "object O { def theCatSatOnTheMat = 1 }; import O._; tCSO")("theCatSatOnTheMat")
checkExact(completer, "object O { def getBlerganator = 1 }; import O._; blerga")("getBlerganator")
checkExact(completer, "object O { def xxxxYyyyyZzzz = 1; def xxxxYyZeee = 1 }; import O._; xYZ")("", "xxxxYyyyyZzzz", "xxxxYyZeee")
checkExact(completer, "object O { def xxxxYyyyyZzzz = 1; def xxxxYyyyyZeee = 1 }; import O._; xYZ")("xxxxYyyyyZzzz", "xxxxYyyyyZeee")
checkExact(completer, "object O { class AbstractMetaFactoryFactory }; new O.AMFF")("AbstractMetaFactoryFactory")
checkExact(completer, "object O { val DECIMAL_DIGIT_NUMBER = 0 }; import O._; L_")("DECIMAL_DIGIT_NUMBER")
checkExact(completer, "object O { val _unusualIdiom = 0 }; import O._; _ui")("_unusualIdiom")
}
@Test
def lenientCamelCompletions(): Unit = {
val completer = setup()
checkExact(completer, "object O { def theCatSatOnTheMat = 1 }; import O._; tcso")("theCatSatOnTheMat")
checkExact(completer, "object O { def theCatSatOnTheMat = 1 }; import O._; sotm")("theCatSatOnTheMat")
checkExact(completer, "object O { def theCatSatOnTheMat = 1 }; import O._; caton")("theCatSatOnTheMat")
checkExact(completer, "object O { def theCatSatOnTheMat = 1; def catOnYoutube = 2 }; import O._; caton")("", "theCatSatOnTheMat", "catOnYoutube")
checkExact(completer, "object O { def theCatSatOnTheMat = 1 }; import O._; TCSOTM")()
}
@Test
def snakeCompletions(): Unit = {
val completer = setup()
checkExact(completer, "object O { final val THE_CAT_SAT_ON_THE_MAT = 1 }; import O._; TCSO")("THE_CAT_SAT_ON_THE_MAT")
checkExact(completer, "object O { final val THE_CAT_SAT_ON_THE_MAT = 1 }; import O._; tcso")("THE_CAT_SAT_ON_THE_MAT")
checkExact(completer, "object C { def isIdentifierIgnorable = ??? ; val DECIMAL_DIGIT_NUMBER = 0 }; import C._; iii")("isIdentifierIgnorable")
}
@Test
def performanceOfLenientMatch(): Unit = {
val completer = setup()
val ident: String = "thisIsAReallyLongMethodNameWithManyManyManyManyChunks"
checkExact(completer, s"($ident: Int) => tia")(ident)
} |
Assigning myself because this is a pet feature of mine that I'd like to have back. I might tinker with the upstream contribution to JLine. I'll post my status here if/when I actively start working on this, feel free to work-steal the back, Seth, if you want to work on it yourself. |
Started the upstream PR: jline/jline3#626 |
I have a WIP PR that integrates the new JLine. So far so good. There are a few points to tidy up before I submit. |
I went ahead and PRed the JLine upgrade separately: scala/scala#9467 , as I think we'll want it regardless and now's a good time to be testing it |
I'm quite happy with the state of my work in retronym/scala#110. See the PR description for the fixes and new features. @som-snytt @SethTisue would you like to give it a spin and see if you can spot any bugs or UI improvement ideas? |
PR: scala/scala#9656 |
for example, previously
System.rFOE
would complete toSystem.runFinalizersOnExit
, but it doesn't anymoreThe text was updated successfully, but these errors were encountered: