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

improve str macro doc help #39110

Merged
merged 4 commits into from
Apr 2, 2022
Merged

Conversation

Moelf
Copy link
Contributor

@Moelf Moelf commented Jan 5, 2021

close #38334
before:

help?> raw
search: RawFD @raw_str RoundNearestTiesAway

Couldn't find raw
Perhaps you meant rand, read, real, rpad, rem, rm, run, NaN, Val, cat, map, max, tan, new, RawFD, ratio, randn or range
  No documentation found

after:

help?> raw
search: RawFD raw"" @raw_str RoundNearestTiesAway

Couldn't find raw
Perhaps you meant rand, read, real, rpad, rem, rm, run, NaN, Val, cat, map, max, tan, new, RawFD, randn, range or read!
  No documentation found.

Copy link
Member

@NHDaly NHDaly left a comment

Choose a reason for hiding this comment

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

Looks great to me! :) thanks for the PR!

stdlib/REPL/src/docview.jl Outdated Show resolved Hide resolved
@NHDaly
Copy link
Member

NHDaly commented Feb 22, 2021

Some of your tests are failing. Also, it would help if you updated the description comment on this PR with an indication of what this changes, and included a before/after example output from the help system.

@NHDaly
Copy link
Member

NHDaly commented Feb 22, 2021

Ah, the failing test should be easy to fix.

I copied this from the buildbot links above:

Error in testset REPL:
Test Failed at /Users/julia/buildbot/worker-tabularasa/tester_macos64/build/share/julia/stdlib/v1.7/REPL/test/replcompletions.jl:10
  Expression: (REPL.doc_completions(i))[1] == i
   Evaluated: "var\"\"" == "@var_str"

And here's the test it's referring to:

symbols = ["?","=","[]","[","]","{}","{","}",";","","'","&&","||","julia","Julia","new","@var_str"]
for i in symbols
@test REPL.doc_completions(i)[1]==i
end
end

That last test will fail, since when you ask for doc_completions("@var_str"), the first result is now var"". You could probably resolve this by changing that line to:

         @test i  REPL.doc_completions(i)

And you might also want to add var"" to the list of search strings?

@Moelf
Copy link
Contributor Author

Moelf commented Feb 22, 2021

And you might also want to add var"" to the list of search strings?

what does this mean?

@ViralBShah
Copy link
Member

Let's rebase this to prepare for merging.

@NHDaly
Copy link
Member

NHDaly commented Apr 1, 2022

And you might also want to add var"" to the list of search strings?

what does this mean?

sorry for my looooong delay. i think that i must have misunderstood something - my concern is addressed. ✅

@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Apr 1, 2022
@ViralBShah
Copy link
Member

Merge?

1 similar comment
@ViralBShah
Copy link
Member

Merge?

@giordano giordano merged commit 8823058 into JuliaLang:master Apr 2, 2022
@giordano giordano added docs This change adds or pertains to documentation and removed merge me PR is reviewed. Merge when all tests are passing labels Apr 2, 2022
@Moelf
Copy link
Contributor Author

Moelf commented Apr 2, 2022

back port 1.8?

@Moelf Moelf deleted the better_str_macro_help branch April 2, 2022 17:29
@@ -720,7 +720,19 @@ accessible(mod::Module) =
map(names, moduleusings(mod))...;
collect(keys(Base.Docs.keywords))] |> unique |> filtervalid

doc_completions(name) = fuzzysort(name, accessible(Main))
function doc_completions(name)
Copy link
Contributor

Choose a reason for hiding this comment

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

Ugh, this line had a trailing whitespace

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops

@ViralBShah ViralBShah added the backport 1.8 Change should be backported to release-1.8 label Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.8 Change should be backported to release-1.8 docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

improve help search for string macros
5 participants