Conversation
Can be user defined as the new global `g:any_jump_glob_scanner` and its value is only conditionally used inside `RunRgDefinitionSearch()` (for now, not sure if in side `RunRgUsagesSearch()` is also useful/warranted?) Notes: - only implemented thus far for `rg` backend - not sure if it's "smarter" to avoid use of `rg -u` filter removal and instead use `-g <PATH>` or some other `.gitignore` override thingy?
goodboy
commented
Nov 23, 2023
| let cmd = cmd . s:GetRgIgnoreSpecifier() | ||
| let cmd = cmd . ' ' . a:patterns | ||
|
|
||
| " NOTE: the `-e` is ok here to be explicit right? |
Author
There was a problem hiding this comment.
Figured it was better then being implicit?
goodboy
commented
Nov 23, 2023
| let scan_cmd = g:any_jump_glob_scanner | ||
| if strlen(scan_cmd) | ||
| let scan_results = system(scan_cmd) | ||
| " echo 'Additional ' a:language . ' PATHs to scan: ' . scan_results |
Author
There was a problem hiding this comment.
was just left in for debugging, obviously can be removed.
goodboy
commented
Nov 23, 2023
| let cmd = cmd . ' ' . scan_results | ||
| endif | ||
|
|
||
| " TODO: is it more correct to pass `-g <glob>` flags here? |
Author
There was a problem hiding this comment.
Would like feedback on whether this (or something else) is a better approach?
Also see the TODOs in the description.
goodboy
commented
Nov 23, 2023
|
|
||
| " Custom glob scanning command used to dynamically | ||
| " produce PATHs fed into `rg`/`ag` | ||
| call s:set_plugin_global_option('any_jump_glob_scanner', '') |
Author
There was a problem hiding this comment.
not sold on this name yet either 馃槀
suggestions welcome!
Author
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.
An attempt to resolve #112.
I'm not sure if this kinda thing will make all that much sense for AOT compiled langs (since often getting lib symbols isn't so straight forward as running some command to produce source-code-file-containing directories) but, it definitely is a thing in a language like
pythonwhich users often dev / deploy in "isolated" runtime environments ("virtual envs"). In this case I have defined my custom glob scanner as:which allows searching symbol defs in the user's locally activated python runtime env and thus the env specific
../site-packages/*.Also included are some slight formatting tweaks in a couple of spots that seemed to have extra whitespace and a couple tweaks to the
rg -g '!<globpatt>'quoting to work better when echoing the full cmd from vim for manuall copy/pasta debugging.Still TODO
g:any_jump_glob_scannerand its value is only conditionally used insideRunRgDefinitionSearch()(for now, not sure if in sideRunRgUsagesSearch()is also useful/warranted?)-[ ] currently only implemented thus far for
rgbackendrg -ufilter removal and instead use-g <PATH>or some other >.gitignoreoverride thingy?agsupport!rg