Skip to content

Commit

Permalink
Relax a couple of REPL signatures (#37998)
Browse files Browse the repository at this point in the history
Fixes #37765 and PyPlot docs
  • Loading branch information
timholy authored Oct 13, 2020
1 parent c91a750 commit a1da84c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions stdlib/REPL/src/REPL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,9 @@ function complete_line(c::ShellCompletionProvider, s::PromptState)
return unique!(map(completion_text, ret)), partial[range], should_complete
end

function complete_line(c::LatexCompletions, s::PromptState)
function complete_line(c::LatexCompletions, s)
partial = beforecursor(LineEdit.buffer(s))
full = LineEdit.input_string(s)
full = LineEdit.input_string(s)::String
ret, range, should_complete = bslash_completions(full, lastindex(partial))[2]
return unique!(map(completion_text, ret)), partial[range], should_complete
end
Expand Down
3 changes: 2 additions & 1 deletion stdlib/REPL/src/docview.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ end
_helpmode(line::AbstractString) = _helpmode(stdout, line)

# Print vertical lines along each docstring if there are multiple docs
function insert_hlines(io::IO, docs::Markdown.MD)
function insert_hlines(io::IO, docs)
if !isa(docs, Markdown.MD) || !haskey(docs.meta, :results) || isempty(docs.meta[:results])
return docs
end
docs = docs::Markdown.MD
v = Any[]
for (n, doc) in enumerate(docs.content)
push!(v, doc)
Expand Down
5 changes: 5 additions & 0 deletions stdlib/REPL/test/docview.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

using Test
import REPL
import Markdown

@testset "symbol completion" begin
@test startswith(let buf = IOBuffer()
Expand All @@ -14,3 +15,7 @@ import REPL
String(take!(buf))
end, "\"🐨\" can be typed by \\:koala:<tab>\n")
end

@testset "Non-Markdown" begin
@test isa(REPL.insert_hlines(IOBuffer(), Markdown.Text("foo")), Markdown.Text)
end

4 comments on commit a1da84c

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - successfully executed benchmarks. A full report can be found here. cc @christopher-dG

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - possible new issues were detected. A full report can be found here. cc @maleadt

Please sign in to comment.