Partial matching for restrict_sources#9
Open
hc-nolan wants to merge 6 commits intoemmanueltouzery:mainfrom
Open
Partial matching for restrict_sources#9hc-nolan wants to merge 6 commits intoemmanueltouzery:mainfrom
restrict_sources#9hc-nolan wants to merge 6 commits intoemmanueltouzery:mainfrom
Conversation
Modified all usages of restrict_sources to consider partial matches.
E.g., previously, `restrict_sources={"python"}` would fail to find
`python~3.13`, whereas now that will be considered a match.
Also added an example remap to the README that shows how this can be
used to search the docs for the current file's language automatically.
Note: does not currently function with `telescope.apidocs_open`, only `telescope.apidocs_search`.
Contributor
Author
|
Incorporated your feedback One thing to note is that I haven't been successful in getting this to work with Telescope's |
2d32d79 to
7fc1c9d
Compare
Owner
|
for telescope apidocs_open, the modifications in line 40 of lua/apidocs.lua ought to do it. "candidates" is what's fed into the telescope picker? |
Contributor
Author
Oh yeah, you're right. I must have switched branches when I looked at Telescope because I remember it not working, but it is indeed working properly in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Originally discussed in #8.
Expanded the pattern matching expression so it is more precise:
"^" .. source .. "~%d+(%.%d+)?$"- so "python" will match directoriespython,python~3, orpython~3.13.Added partial string matching for restrict_sources. Previously, the exact directory name had to be entered, e.g. python~3.13 rather than just python. With the new approach, if restrict_sources contains a value python, any directories starting with python will be considered valid. The motivation for this is demonstrated in the README example - we can now automatically restrict the sources for the language of the current file, and we won't have issues if the language docs have the version in their name: