-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
REPL: when tab-completing, don't show a method as deprecated unless all overloads are deprecated #9510
Conversation
this isn't the behavior I expected:
I had expected just:
do you think the way you did it is better? |
I think |
@SethTisue Since Jline3 uses map when matching, only one key of the same group (default is ``) can be reserved. So it seems Scala itself can't fix the problem? Of course, we can try to put the one with description in front of the candidate list to get a candidate without description after covering, but I don't like this, what about you? |
This comment has been minimized.
This comment has been minimized.
a306191
to
a8976a1
Compare
src/repl-frontend/scala/tools/nsc/interpreter/shell/ReplCompletion.scala
Outdated
Show resolved
Hide resolved
src/repl-frontend/scala/tools/nsc/interpreter/shell/ReplCompletion.scala
Outdated
Show resolved
Hide resolved
@jxnu-liguobin I like the behavior now. Can you squash this into a single commit? Then I think we can merge it. |
yes |
712e8f2
to
eafe1cf
Compare
eafe1cf
to
decec2e
Compare
@SethTisue Done, and I rolled back the modification to the minor problem because I couldn't reproduce it. If you find out, just point it to me. |
We can always adjust it again later if we notice something. |
Thank you! |
Re-enable acronmyn-style completion, e.g. getClass.gdm` offers `getDeclaredMethod[s]`. Under JLine completion, move all filtering up in the UI layer. Reimplement scala#9510 (dealing with overloads that contain some deprecated alternatives) in the UI layer Fix completion of keyword-starting-idents (e.g. `this.for<TAB>` offers `formatted`. Register a widget on CTRL-SHIFT-T that prints the type of the expression at the cursor. A second invokation prints the desugared AST. Enable levenstien based typo matching, but disable it for short strings which IMO tends to offer confusing results. ``` REPL completion - Enable levenstien based typo matching scala> scala.tools.nsc.util.EditDistance.levenshtien<TAB> scala> scala.tools.nsc.util.EditDistance.levenshtein ```
Re-enable acronym-style completion, e.g. getClass.gdm` offers `getDeclaredMethod[s]`. Under JLine completion, move all filtering up in the UI layer. Reimplement scala#9510 (dealing with overloads that contain some deprecated alternatives) in the UI layer Fix completion of keyword-starting-idents (e.g. `this.for<TAB>` offers `formatted`. Register a widget on CTRL-SHIFT-T that prints the type of the expression at the cursor. A second invokation prints the desugared AST. Enable levenstien based typo matching, but disable it for short strings which IMO tends to offer confusing results. Enable levenstien based typo matching: ``` scala> scala.tools.nsc.util.EditDistance.levenshtien<TAB> scala> scala.tools.nsc.util.EditDistance.levenshtein ```
Re-enable acronym-style completion, e.g. getClass.gdm` offers `getDeclaredMethod[s]`. Under JLine completion, move all filtering up in the UI layer. Reimplement scala#9510 (dealing with overloads that contain some deprecated alternatives) in the UI layer Fix completion of keyword-starting-idents (e.g. `this.for<TAB>` offers `formatted`. Register a widget on CTRL-SHIFT-T that prints the type of the expression at the cursor. A second invokation prints the desugared AST. Enable levenstien based typo matching, but disable it for short strings which IMO tends to offer confusing results. Enable levenstien based typo matching: ``` scala> scala.tools.nsc.util.EditDistance.levenshtien<TAB> scala> scala.tools.nsc.util.EditDistance.levenshtein ```
Re-enable acronym-style completion, e.g. getClass.gdm` offers `getDeclaredMethod[s]`. Under JLine completion, move all filtering up in the UI layer. Reimplement scala#9510 (dealing with overloads that contain some deprecated alternatives) in the UI layer Fix completion of keyword-starting-idents (e.g. `this.for<TAB>` offers `formatted`. Register a widget on CTRL-SHIFT-T that prints the type of the expression at the cursor. A second invokation prints the desugared AST. Enable levenstien based typo matching, but disable it for short strings which IMO tends to offer confusing results. Enable levenstien based typo matching: ``` scala> scala.tools.nsc.util.EditDistance.levenshtien<TAB> scala> scala.tools.nsc.util.EditDistance.levenshtein ```
Re-enable acronym-style completion, e.g. getClass.gdm` offers `getDeclaredMethod[s]`. Under JLine completion, move all filtering up in the UI layer. Reimplement scala#9510 (dealing with overloads that contain some deprecated alternatives) in the UI layer Fix completion of keyword-starting-idents (e.g. `this.for<TAB>` offers `formatted`. Register a widget on CTRL-SHIFT-T that prints the type of the expression at the cursor. A second invokation prints the desugared AST. Enable levenstien based typo matching, but disable it for short strings which IMO tends to offer confusing results. Enable levenstien based typo matching: ``` scala> scala.tools.nsc.util.EditDistance.levenshtien<TAB> scala> scala.tools.nsc.util.EditDistance.levenshtein ```
Re-enable acronym-style completion, e.g. getClass.gdm` offers `getDeclaredMethod[s]`. Under JLine completion, move all filtering up in the UI layer. Reimplement scala#9510 (dealing with overloads that contain some deprecated alternatives) in the UI layer Fix completion of keyword-starting-idents (e.g. `this.for<TAB>` offers `formatted`. Register a widget on CTRL-SHIFT-T that prints the type of the expression at the cursor. A second invokation prints the desugared AST. Enable levenstien based typo matching, but disable it for short strings which IMO tends to offer confusing results. Enable levenstien based typo matching: ``` scala> scala.tools.nsc.util.EditDistance.levenshtien<TAB> scala> scala.tools.nsc.util.EditDistance.levenshtein ```
Re-enable acronym-style completion, e.g. getClass.gdm` offers `getDeclaredMethod[s]`. Under JLine completion, move all filtering up in the UI layer. Reimplement scala#9510 (dealing with overloads that contain some deprecated alternatives) in the UI layer Fix completion of keyword-starting-idents (e.g. `this.for<TAB>` offers `formatted`. Register a widget on CTRL-SHIFT-T that prints the type of the expression at the cursor. A second invokation prints the desugared AST. Enable levenstien based typo matching, but disable it for short strings which IMO tends to offer confusing results. Enable levenstien based typo matching: ``` scala> scala.tools.nsc.util.EditDistance.levenshtien<TAB> scala> scala.tools.nsc.util.EditDistance.levenshtein ```
Re-enable acronym-style completion, e.g. getClass.gdm` offers `getDeclaredMethod[s]`. Under JLine completion, move all filtering up in the UI layer. Reimplement scala#9510 (dealing with overloads that contain some deprecated alternatives) in the UI layer Fix completion of keyword-starting-idents (e.g. `this.for<TAB>` offers `formatted`. Register a widget on CTRL-SHIFT-T that prints the type of the expression at the cursor. A second invokation prints the desugared AST. Enable levenstien based typo matching, but disable it for short strings which IMO tends to offer confusing results. Enable levenstien based typo matching: ``` scala> scala.tools.nsc.util.EditDistance.levenshtien<TAB> scala> scala.tools.nsc.util.EditDistance.levenshtein ```
Re-enable acronym-style completion, e.g. getClass.gdm` offers `getDeclaredMethod[s]`. Under JLine completion, move all filtering up in the UI layer. Reimplement scala#9510 (dealing with overloads that contain some deprecated alternatives) in the UI layer Fix completion of keyword-starting-idents (e.g. `this.for<TAB>` offers `formatted`. Register a widget on CTRL-SHIFT-T that prints the type of the expression at the cursor. A second invokation prints the desugared AST. Enable levenstien based typo matching, but disable it for short strings which IMO tends to offer confusing results. Enable levenstien based typo matching: ``` scala> scala.tools.nsc.util.EditDistance.levenshtien<TAB> scala> scala.tools.nsc.util.EditDistance.levenshtein ```
Putting candidates with description information in front and candidates without description information in the back, eventually only those without description will be displayed due to the de-duplication of Map Key.