mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[IDE] Search all comments for 'FIXME:', 'TODO:', 'MARK:' and report them in the syntax model.
Swift SVN r19423
This commit is contained in:
@@ -114,12 +114,14 @@ unsigned SourceManager::getByteDistance(SourceLoc Start, SourceLoc End) const {
|
||||
return End.Value.getPointer() - Start.Value.getPointer();
|
||||
}
|
||||
|
||||
StringRef SourceManager::extractText(CharSourceRange Range) const {
|
||||
StringRef SourceManager::extractText(CharSourceRange Range,
|
||||
Optional<unsigned> BufferID) const {
|
||||
assert(Range.isValid() && "range should be valid");
|
||||
|
||||
unsigned BufferID = findBufferContainingLoc(Range.getStart());
|
||||
StringRef Buffer = LLVMSourceMgr.getMemoryBuffer(BufferID)->getBuffer();
|
||||
return Buffer.substr(getLocOffsetInBuffer(Range.getStart(), BufferID),
|
||||
if (!BufferID)
|
||||
BufferID = findBufferContainingLoc(Range.getStart());
|
||||
StringRef Buffer = LLVMSourceMgr.getMemoryBuffer(*BufferID)->getBuffer();
|
||||
return Buffer.substr(getLocOffsetInBuffer(Range.getStart(), *BufferID),
|
||||
Range.getByteLength());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user