-
Notifications
You must be signed in to change notification settings - Fork 0
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
[pull] main from facebook:main #26
Conversation
…ection.getNodes() (#7135)
🚨 gitStream Monthly Automation Limit Reached 🚨 Your organization has exceeded the number of pull requests allowed for automation with gitStream. To continue automating your PR workflows and unlock additional features, please contact LinearB. |
Reviewer's Guide by SourceryThis pull request introduces enhancements and refactoring to the LexicalCaret and LexicalNode modules, focusing on improving caret handling and node comparison functionalities. It includes new utility functions for caret comparison and common ancestor determination, as well as updates to existing methods to utilize these new utilities. Updated class diagram for LexicalCaret and LexicalNodeclassDiagram
class CaretRangeImpl {
+getTextSlices() TextPointCaretSliceTuple
+iterNodeCarets(rootMode: RootMode) IterableIterator
}
class LexicalNode {
+getCommonAncestor(node: LexicalNode) T | null
+isBefore(targetNode: LexicalNode) boolean
+isParentOf(targetNode: LexicalNode) boolean
}
class CommonAncestorResult {
<<interface>>
}
class CommonAncestorResultSame {
<<interface>>
+type: 'same'
+commonAncestor: A
}
class CommonAncestorResultAncestor {
<<interface>>
+type: 'ancestor'
+commonAncestor: A
}
class CommonAncestorResultDescendant {
<<interface>>
+type: 'descendant'
+commonAncestor: B
}
class CommonAncestorResultBranch {
<<interface>>
+type: 'branch'
+commonAncestor: ElementNode
+a: A | ElementNode
+b: B | ElementNode
}
CaretRangeImpl --> LexicalNode
CommonAncestorResult <|-- CommonAncestorResultSame
CommonAncestorResult <|-- CommonAncestorResultAncestor
CommonAncestorResult <|-- CommonAncestorResultDescendant
CommonAncestorResult <|-- CommonAncestorResultBranch
LexicalNode --> CommonAncestorResult
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.1)
Can you help keep this open source service alive? 💖 Please sponsor : )
Summary by Sourcery
Refactor and enhance caret and code highlighting functionalities by introducing new functions with
$
prefixes, deprecating older methods, and adding comprehensive test cases for new features. Improve theRangeSelection
method for node retrieval and update documentation with deprecation notices.New Features:
$comparePointCaretNext
to provide a total ordering forPointCaret<'next'>
based on the order aCaretRange
would iterate them.Enhancements:
getNodes
method inRangeSelection
to use a new function$getNodesFromCaretRangeCompat
for improved compliance with quirks of the original method.getCommonAncestor
method inLexicalNode
in favor of the new$getCommonAncestor
function for finding common ancestors of nodes.$
prefix, such as$getFirstCodeNodeOfLine
and$getLastCodeNodeOfLine
.Documentation:
LexicalNode
and code highlighting functions, guiding users to use the new$
prefixed functions.Tests:
$comparePointCaretNext
and$getCommonAncestor
functions to ensure correct functionality and ordering of caret points.