mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Don't annotatae entities not in the primary buffer
This commit is contained in:
@@ -945,13 +945,13 @@ public:
|
||||
if (AvailableAttr::isUnavailable(D))
|
||||
return true;
|
||||
|
||||
Optional<unsigned> inBufferID;
|
||||
if (SM.getRangeForBuffer(BufferID).contains(Range.getStart()))
|
||||
inBufferID = BufferID;
|
||||
// FIXME: Ignore things that don't come from this buffer.
|
||||
if (!SM.getRangeForBuffer(BufferID).contains(Range.getStart()))
|
||||
return true;
|
||||
|
||||
auto &SM = D->getASTContext().SourceMgr;
|
||||
if (D == D->getASTContext().getOptionalNoneDecl() &&
|
||||
SM.extractText(Range, inBufferID) == "nil") {
|
||||
SM.extractText(Range, BufferID) == "nil") {
|
||||
// If a 'nil' literal occurs in a swift-case statement, it gets replaced
|
||||
// by a reference to 'Optional.none' in the AST. We want to continue
|
||||
// highlighting 'nil' as a keyword and not as an enum element.
|
||||
|
||||
Reference in New Issue
Block a user