-
Notifications
You must be signed in to change notification settings - Fork 80
Renamed getStart => getStartPosition for consistency. #156
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
Conversation
- Renamed getStart to getStartPosition to be consistent with getEndPosition.
@dantleech, It will cover your contributions to all Microsoft-managed open source projects. |
@dantleech, thanks for signing the contribution license agreement. We will now validate the agreement and then the pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change
@@ -354,7 +354,7 @@ public function jsonSerialize() { | |||
} | |||
|
|||
/** | |||
* Get the end index of a Node. | |||
* Get the end position of a Node. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
index (=offset) is more precise than position. Position can also mean (line, column).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method uses the term Position
. Maybe we should change the API to get[Start|End]Offset
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've thought about this, 'position' is not ideal because the language server protocol uses it for line/col and the parser also has LineCharacterPosition
. There are a ton of references to 'position' so it would be a pain to change, but either index or offset would be better for this.
I'm going to close this for the reasons in the comment above, but I still want to make these names consistent. I filed #166 to come up with better names. |
Renamed
Node#getStart
toNode#getStartPosition
to be consistent withNode#getEndPosition
.