-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[IDE] Check whether an AST node contains the IDE inspection point based on CharSourceRange
#63714
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
[IDE] Check whether an AST node contains the IDE inspection point based on CharSourceRange
#63714
Conversation
@swift-ci Please smoke test |
return IDEInspectionTargetBufferID | ||
? rangeContainsTokenLoc(R, getIDEInspectionTargetLoc()) | ||
: false; | ||
bool rangeContainsIDEInspectionTarget(CharSourceRange R) const { |
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.
Why can't we take a SourceRange and call Lexer::getCharSourceRangeFromSourceRange
here rather than having to pass it in everywhere?
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.
Because the Basic
library can’t depend on Lexer
.
49eb4d6
to
afd620e
Compare
@swift-ci Please smoke test |
afd620e
to
8b51ef6
Compare
@swift-ci Please smoke test |
@@ -126,6 +126,14 @@ class CompletionContextFinder : public ASTWalker { | |||
} | |||
}; | |||
|
|||
|
|||
/// Returns \c true` if \p range is valid and contains the IDE inspection |
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.
Nit: stray "`" after "true"
…ed on `CharSourceRange` This fixes an issue if the range ends with a string literal that contains the IDE inspection target. In that case the end of the range will point to the start of the string literal but the IDE inspection target is inside the string literal and thus after the range’s end.
8b51ef6
to
8bdf68d
Compare
@swift-ci Please smoke test and merge |
This fixes an issue if the range ends with a string literal that contains the IDE inspection target. In that case the end of the range will point to the start of the string literal but the IDE inspection target is inside the string literal and thus after the range’s end.