Skip to content

Commit 1cd5d2e

Browse files
committed
Bring back SourceManager::rangeContainsCodeCompletionLoc()
1 parent 95132fd commit 1cd5d2e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/swift/Basic/SourceManager.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ class SourceManager {
103103
rangeContainsTokenLoc(Enclosing, Inner.End);
104104
}
105105

106+
/// Returns true if range \p R contains the code-completion location, if any.
107+
bool rangeContainsCodeCompletionLoc(SourceRange R) const {
108+
return CodeCompletionBufferID
109+
? rangeContainsTokenLoc(R, getCodeCompletionLoc())
110+
: false;
111+
}
112+
106113
/// Returns the buffer ID for the specified *valid* location.
107114
///
108115
/// Because a valid source location always corresponds to a source buffer,

0 commit comments

Comments
 (0)