mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #81809 from hamishknight/range-expansion
[SourceKit] Properly handle cursor info range for macro expansions
This commit is contained in:
@@ -434,10 +434,18 @@ public:
|
||||
/// \c nullptr if the source location isn't in this module.
|
||||
SourceFile *getSourceFileContainingLocation(SourceLoc loc);
|
||||
|
||||
// Retrieve the buffer ID and source range of the outermost node that
|
||||
// caused the generation of the buffer containing \p range. \p range and its
|
||||
// buffer if it isn't in a generated buffer or has no original range.
|
||||
std::pair<unsigned, SourceRange> getOriginalRange(SourceRange range) const;
|
||||
|
||||
// Retrieve the buffer ID and source location of the outermost location that
|
||||
// caused the generation of the buffer containing \p loc. \p loc and its
|
||||
// buffer if it isn't in a generated buffer or has no original location.
|
||||
std::pair<unsigned, SourceLoc> getOriginalLocation(SourceLoc loc) const;
|
||||
std::pair<unsigned, SourceLoc> getOriginalLocation(SourceLoc loc) const {
|
||||
auto [buffer, range] = getOriginalRange(loc);
|
||||
return std::make_pair(buffer, range.Start);
|
||||
}
|
||||
|
||||
/// Creates a map from \c #filePath strings to corresponding \c #fileID
|
||||
/// strings, diagnosing any conflicts.
|
||||
|
||||
Reference in New Issue
Block a user