Skip to content

Use helper functions in a few more places#21308

Merged
6 commits merged into
masterfrom
helpers
Jun 30, 2018
Merged

Use helper functions in a few more places#21308
6 commits merged into
masterfrom
helpers

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Jan 19, 2018

No description provided.

@ghost ghost requested a review from armanio123 January 19, 2018 22:01
Comment thread src/services/completions.ts Outdated
}
}
return firstDefined((getJsDocHavingNode(node) as JSDocContainer).jsDoc, ({ pos, end, tags }) =>
pos <= position && position <= end ? findLast(tags, tag => position >= tag.pos) : undefined);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Pretty sure we have helper functions for determining inclusion of positions.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Added a textRangeContainsPositionInclusive helper.

Comment thread src/services/goToDefinition.ts Outdated
return undefined;

function findReferenceInPosition(refs: ReadonlyArray<FileReference>, pos: number): FileReference | undefined {
return find(refs, ref => ref.pos <= pos && pos <= ref.end);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same here

@ghost
Copy link
Copy Markdown
Author

ghost commented Feb 27, 2018

@DanielRosenwasser Could you review again?

@typescript-bot
Copy link
Copy Markdown
Collaborator

Thanks for your contribution. This PR has not been updated in a while and cannot be automatically merged at the time being. For housekeeping purposes we are closing stale PRs. If you'd still like to continue working on this PR, please leave a message and one of the maintainers can reopen it.

@ghost ghost reopened this Jun 28, 2018
@ghost
Copy link
Copy Markdown
Author

ghost commented Jun 28, 2018

@DanielRosenwasser Could you review again?

@ghost ghost merged commit a1746d4 into master Jun 30, 2018
@ghost ghost deleted the helpers branch June 30, 2018 03:07
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants