-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Use helper functions in a few more places #21308
Conversation
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); |
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.
Pretty sure we have helper functions for determining inclusion of positions.
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.
Added a textRangeContainsPositionInclusive
helper.
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); |
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.
Same here
@DanielRosenwasser Could you review again? |
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. |
@DanielRosenwasser Could you review again? |
No description provided.