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

REPL: when tab-completing, don't show a method as deprecated unless all overloads are deprecated #9510

Merged
merged 1 commit into from
Mar 28, 2021

Conversation

jxnu-liguobin
Copy link
Member

@jxnu-liguobin jxnu-liguobin commented Feb 19, 2021

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.

@scala-jenkins scala-jenkins added this to the 2.13.6 milestone Feb 19, 2021
@SethTisue SethTisue self-requested a review February 19, 2021 15:35
@SethTisue SethTisue added the tool:REPL Changes in the Scala REPL Interpreter label Feb 19, 2021
@SethTisue SethTisue changed the title Fixes scala/bug#12338 REPL: when tab-completing, don't show a method is deprecated unless all overloads are deprecated Feb 19, 2021
@SethTisue SethTisue changed the title REPL: when tab-completing, don't show a method is deprecated unless all overloads are deprecated REPL: when tab-completing, don't show a method as deprecated unless all overloads are deprecated Feb 19, 2021
@SethTisue
Copy link
Member

this isn't the behavior I expected:

scala> "get".getBytes
getBytes(
getBytes( (deprecated)

I had expected just:

scala> "get".getBytes
getBytes(

do you think the way you did it is better?

@jxnu-liguobin
Copy link
Member Author

getBytes

I think getBytes hides some information.

@jxnu-liguobin
Copy link
Member Author

@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?

@jxnu-liguobin

This comment has been minimized.

@jxnu-liguobin jxnu-liguobin force-pushed the fix-12338 branch 5 times, most recently from a306191 to a8976a1 Compare March 23, 2021 09:12
@SethTisue
Copy link
Member

@jxnu-liguobin I like the behavior now. Can you squash this into a single commit? Then I think we can merge it.

@jxnu-liguobin
Copy link
Member Author

I like the behavior now. Can you squash this into a single commit? Then I think we can merge it.

yes

@jxnu-liguobin jxnu-liguobin force-pushed the fix-12338 branch 3 times, most recently from 712e8f2 to eafe1cf Compare March 27, 2021 02:36
@jxnu-liguobin
Copy link
Member Author

@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.

@SethTisue
Copy link
Member

We can always adjust it again later if we notice something.

@SethTisue SethTisue merged commit 107c727 into scala:2.13.x Mar 28, 2021
@SethTisue
Copy link
Member

Thank you!

@jxnu-liguobin jxnu-liguobin deleted the fix-12338 branch March 29, 2021 01:59
retronym added a commit to retronym/scala that referenced this pull request May 20, 2021
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
```
retronym added a commit to retronym/scala that referenced this pull request Jun 5, 2021
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
```
retronym added a commit to retronym/scala that referenced this pull request Jun 5, 2021
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
```
retronym added a commit to retronym/scala that referenced this pull request Jun 5, 2021
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
```
retronym added a commit to retronym/scala that referenced this pull request Jun 5, 2021
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
```
retronym added a commit to retronym/scala that referenced this pull request Jun 5, 2021
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
```
retronym added a commit to retronym/scala that referenced this pull request Jun 5, 2021
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
```
retronym added a commit to retronym/scala that referenced this pull request Jun 6, 2021
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
```
retronym added a commit to retronym/scala that referenced this pull request Jun 6, 2021
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
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tool:REPL Changes in the Scala REPL Interpreter
Projects
None yet
5 participants