Fix resolution of reference tags in a referenced docstring#1487
Open
notEthan wants to merge 2 commits intolsegal:mainfrom
Open
Fix resolution of reference tags in a referenced docstring#1487notEthan wants to merge 2 commits intolsegal:mainfrom
notEthan wants to merge 2 commits intolsegal:mainfrom
Conversation
…associated with a different object
lsegal
reviewed
Apr 8, 2023
| # with. | ||
| def initialize(content = '', object = nil) | ||
| @object = object | ||
| @namespace = object |
Owner
There was a problem hiding this comment.
It kind of seems like .namespace is just a dupe of .object? Or, at the very least, that namespace could be a combination of @object || @unresolved_reference and thus no attribute would be needed.
| def create_ref_tag(tag_name, name, object_name) | ||
| @tags << Tags::RefTagList.new(tag_name, P(object, object_name), name) | ||
| namespace = object && object.docstring ? object.docstring.namespace : object | ||
| @tags << Tags::RefTagList.new(tag_name, P(namespace, object_name), name) |
Owner
There was a problem hiding this comment.
(See above) I could be wrong but it seems like namespace could be replaced entirely by object || @unresolved_reference and thus be the only necessary line of implementation.
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.
When a docstring X is a reference to another docstring Y, any reference tags within docstring Y are resolved using the namespace of X, causing resolution to fail when X and Y are in different namespaces. This PR adds Docstring#namespace which follows the resolved reference.
Completed Tasks
bundle exec rakelocally (if code is attached to PR).