-
-
Notifications
You must be signed in to change notification settings - Fork 511
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
Add BaseName.definition_[start,end]_position #1584
Add BaseName.definition_[start,end]_position #1584
Conversation
Provides two public (property) methods getting the (row, column) of the start / end of the definition range. Rows start with 1, columns start with 0. :rtype: Tuple[int, int]
I’ll write tests soon, please don’t merge until then! |
@davidhalter I've added the tests! |
Thanks again! I ended up changing a few things that I didn't notice and wanted you to know:
|
@davidhalter ah, gotcha, glad you caught those! That said, the change in 8fdf16b may introduce a bug. The way I read it, if We'd probably want the check to go: if self._name.tree_name is None:
return None
definition = self._name.tree_name.get_definition()
if definition is None:
return self._name.tree_name.end_pos Also, we'd probably also want to do this exact same check for |
…ntion_end_position, see #1584
Very good point. I think we finally arrived at a solid solution :). |
Provides two public (property) methods getting the (row, column) of the start / end of the definition range. Rows start with 1, columns start with 0.
Resolves #1576
Note: I cannot run tests locally so, unfortunately, I didn't write any. See comment in issue mentioned above.