-
Notifications
You must be signed in to change notification settings - Fork 160
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
SuggestedSpellings extended and renamed to HELP_SEARCH_ALTERNATIVES #1144
SuggestedSpellings extended and renamed to HELP_SEARCH_ALTERNATIVES #1144
Conversation
2e1fb99
to
de5888f
Compare
Codecov Report
@@ Coverage Diff @@
## master #1144 +/- ##
==========================================
+ Coverage 59.21% 59.25% +0.04%
==========================================
Files 434 434
Lines 230814 230825 +11
==========================================
+ Hits 136682 136786 +104
+ Misses 94132 94039 -93
Continue to review full report at Codecov.
|
de5888f
to
6c8a3e7
Compare
For any search term starting with |
43aa919
to
06ffefa
Compare
This should be ready to merge now. I've updated this PR to achieve target goals for test coverage. That revealed that one of the tests, (formerly from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me (modulo typos) and worked in a brief test.
lib/helpbase.gi
Outdated
|
||
# Now chop the string 'topic' into a list of lists, each of them either | ||
# a list of all variants from the respective spelling pattern or just | ||
# a one-element list with the "glueing" string between two pattersn or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: pattersn -> patterns
tst/teststandard/helptools.tst
Outdated
@@ -0,0 +1,17 @@ | |||
# This test checks various auxiliary functions used by the help system. | |||
# | |||
# For the test that systematically checks each mahual section, see |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: mahual -> manual
gap> HELP_SEARCH_ALTERNATIVES("hasismapping"); | ||
[ "hasismapping", "ismapping", "setismapping" ] | ||
gap> HELP_SEARCH_ALTERNATIVES("setismapping"); | ||
[ "hasismapping", "ismapping", "setismapping" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps also include HELP_SEARCH_ALTERNATIVES("ismapping")
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I just found one caveat: Try ?hash
. Without this PR, it lists four (relevant) help entries for me). Without it, it turns this into a search for "h" and thus finds countless entries.
Similar for sets
, SetX
, ...
So at the very least, I guess it should require the search string to have more than 4-5 letters.
Better would be if it only took the alternates into account if there are no its. I.e. if "topic" has a hit, just use it, if there are no hits, remove the has
resp. set
prefix. Of course such a change is more complicated than what is in this PR :-/
06ffefa
to
54eaf30
Compare
Codecov Report
@@ Coverage Diff @@
## master #1144 +/- ##
==========================================
+ Coverage 59.39% 59.43% +0.03%
==========================================
Files 434 434
Lines 230498 230509 +11
==========================================
+ Hits 136913 137004 +91
+ Misses 93585 93505 -80
Continue to review full report at Codecov.
|
54eaf30
to
155fb10
Compare
@fingolfin I've made an update. Good catch about |
lib/helpbase.gi
Outdated
|
||
for topic in topics do | ||
if Length(topic) > 4 and topic{[1..3]} in [ "has" , "set" ] and topic[4]<>' ' then | ||
shorttopic := topic{[4..Length(topic)]}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there should be some comments here. One that explains what's going on ("ensure HasIsMapping is found in help even if only IsMapping ismdocumentd"), another which explains that x > 4
is not an off-by-one accident, but rather intentionally (and also what the intention is). Otherwise I am afraid somebody might "fix" it someday .
Now it also ensures that the search for system setters and testers such as e.g. ?SetIsMapping and ?HasIsMapping will return corresponding attributes and properties. e.g. IsMapping.
155fb10
to
a58f136
Compare
@fingolfin comments added, good suggestion. |
This addresses #1019.
Please make sure that this pull request:
Tick all what applies to this pull request
Write below the description of changes (for the release notes)
The search for the documentation of system setters and testers
such as e.g.
?SetIsMapping
and?HasIsMapping
will returncorresponding attributes and properties. e.g.
IsMapping
.