Add capability to jump to MRI C method sources #91
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.
Human-readable explanation of the scope of changes is below:
Overview
This PR adds the ability to (usually!) jump to the C sources of
Ruby methods.
It only works if the user has GNU Global installed and sets a few
Elisp variables to the right values.
If the user doesn't set the variable
robe-use-global-p
to true,the behavior of Robe stays exactly as it is now -- none of
the "jump to C source" machinery is engaged.
Summary of code changes
robe-list-c-method-files
,robe-determine-c-file-for
,robe-jump-to-c-source
robe-use-global-p
,robe-ruby-source-directory
,robe-global-command
robe-jump-to
to add optionalarguments that allow it to pass in the value of
thing-at-point
for the "jump to C source" machinery. Becausethe arguments are optional, we don't need to change any of
robe-jump-to
's callersrobe-jump-to
to check the value ofrobe-use-global-p
to decide whether to try to jump to C method sources. For
users who haven't set this variable, Robe works exactly as it
does today.
Remaining bugs/weird UX
of this is due to GLOBAL, some due to the regex search's
incomplete coverage
M-,
twice for some reason (possibly a
ggtags-mode
thing)twice to jump to C-based definitions, I'm not sure why yet