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

fix REPL completions not always being unique #28694

Merged
merged 2 commits into from
Aug 17, 2018
Merged

Conversation

KristofferC
Copy link
Member

@KristofferC KristofferC commented Aug 16, 2018

Bug introduced in #26930 since completion types with the same text but different type no longer are filtered out by the unique! in completions.

I don't think the filtering should take place in LineEdit since other consumers (with a more rich display system than the REPL) might want to show duplicates with different types.

Gotta think of a test...

Fixes #28692

cc @jamii

@KristofferC KristofferC added REPL Julia's REPL (Read Eval Print Loop) needs tests Unit tests are required for this change bugfix This change fixes an existing bug backport pending 1.0 labels Aug 16, 2018
@jamii
Copy link
Contributor

jamii commented Aug 16, 2018

Ooops.

Seems reasonable.

@KristofferC KristofferC removed the needs tests Unit tests are required for this change label Aug 16, 2018
@stevengj
Copy link
Member

Does this mean that IJulia also has to call unique! since it's not happening in REPLCompletions?

@KristofferC
Copy link
Member Author

Yes, if IJulia only deals with the textual representation of the completion, then that seems desirable.

stevengj added a commit to JuliaLang/IJulia.jl that referenced this pull request Aug 16, 2018
@fredrikekre fredrikekre merged commit cd5e5a3 into master Aug 17, 2018
@fredrikekre fredrikekre deleted the kc/unique_repl branch August 17, 2018 05:55
stevengj added a commit to JuliaLang/IJulia.jl that referenced this pull request Aug 17, 2018
KristofferC added a commit that referenced this pull request Aug 19, 2018
* fix REPLcompletions not unique, fix #28692

(cherry picked from commit cd5e5a3)
KristofferC added a commit that referenced this pull request Aug 19, 2018
* fix REPLcompletions not unique, fix #28692

(cherry picked from commit cd5e5a3)
@KristofferC KristofferC mentioned this pull request Aug 19, 2018
KristofferC added a commit that referenced this pull request Aug 19, 2018
* fix REPLcompletions not unique, fix #28692

(cherry picked from commit cd5e5a3)
KristofferC added a commit that referenced this pull request Sep 8, 2018
* fix REPLcompletions not unique, fix #28692

(cherry picked from commit cd5e5a3)
KristofferC added a commit that referenced this pull request Sep 8, 2018
* fix REPLcompletions not unique, fix #28692

(cherry picked from commit cd5e5a3)
@kalmarek
Copy link
Contributor

The added test fails, since test_complete calls completions (which may be non-unique), but not complete_line:

Worker 1 failed running test REPL:
Some tests did not pass: 984 passed, 1 failed, 0 errored, 5 broken.REPL: Test Failed at /usr/share/julia/stdlib/v1.0/REPL/test/replcompletions.jl:109
  Expression: count(isequal("REPL"), c) == 1
   Evaluated: 2 == 1
Stacktrace:
 [1] record(::Test.DefaultTestSet, ::Test.Fail) at /build/julia/src/julia/usr/share/julia/stdlib/v1.0/Test/src/Test.jl:745
 [2] (::getfield(Main, Symbol("##42#48")))() at /usr/share/julia/test/runtests.jl:237
 [3] cd(::getfield(Main, Symbol("##42#48")), ::String) at ./file.jl:96
 [4] top-level scope at none:0

Test Summary: | Pass  Fail  Broken  Total
  Overall     |  984     1       5    990
    REPL      |  984     1       5    990
    FAILURE

The global RNG seed was 0x632e1e2db9377e27341b33d4eaeea6df.

Error in testset REPL:
Test Failed at /usr/share/julia/stdlib/v1.0/REPL/test/replcompletions.jl:109
  Expression: count(isequal("REPL"), c) == 1
   Evaluated: 2 == 1
ERROR: LoadError: Test run finished with errors
in expression starting at /usr/share/julia/test/runtests.jl:61
ERROR: A test has failed. Please submit a bug report (https://github.com/JuliaLang/julia/issues)
including error messages above and the output of versioninfo():
Julia Version 1.0.1
Commit 0d713926f8 (2018-09-29 19:05 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 2

KristofferC added a commit that referenced this pull request Feb 11, 2019
* fix REPLcompletions not unique, fix #28692

(cherry picked from commit cd5e5a3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This change fixes an existing bug REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants