Skip to content

Fix bugs and docs of FilePositionMap #234

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

Merged
merged 2 commits into from
Feb 19, 2018

Conversation

TysonAndre
Copy link
Contributor

I wasn't using some of those APIs for Node/Token,
and didn't notice the incorrect phpdoc/code.

I wasn't using some of those APIs for Node/Token,
and didn't notice the incorrect phpdoc/code.
@@ -86,19 +86,23 @@ public function getEndLine($node) : int {
* Similar to getStartLine but includes the column
*/
public function getEndLineCharacterPositionForOffset($node) : LineCharacterPosition {
return $this->getLineCharacterPositionForOffset($node);
return $this->getLineCharacterPositionForOffset($node->getEndPosition());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other ForOffset methods take an actual offset, should this one have a different name?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also can $node have a type annotation?

Copy link
Contributor Author

@TysonAndre TysonAndre Feb 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

     /**
      * @param Node|Token $node
      * Similar to getStartLine but includes the column
      */

It has a phpdoc type annotation. It's used both for Node and Token, which have no common interface.

Renamed this method, the original name was incorrect

@roblourens roblourens merged commit 3040143 into microsoft:master Feb 19, 2018
@TysonAndre TysonAndre deleted the fix-FilePositionMap branch June 19, 2018 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants