Skip to content

Commit fcc35c7

Browse files
committed
[SyntaxModel] Don't mark custom attribute as attribute-builtin
rdar://problem/50074156
1 parent d065957 commit fcc35c7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/AST/Decl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ SourceRange Decl::getSourceRangeIncludingAttrs() const {
441441
}
442442

443443
// Attributes on VarDecl syntactically belong to PatternBindingDecl.
444-
if (isa<VarDecl>(this))
444+
if (isa<VarDecl>(this) && !isa<ParamDecl>(this))
445445
return Range;
446446

447447
// Attributes on PatternBindingDecls are attached to VarDecls in AST.

lib/IDE/SyntaxModel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,7 @@ bool ModelASTWalker::handleSpecialDeclAttribute(const DeclAttribute *D,
10261026
ArrayRef<Token> Toks) {
10271027
if (!D)
10281028
return false;
1029-
if (isa<AvailableAttr>(D)) {
1029+
if (isa<AvailableAttr>(D) || isa<CustomAttr>(D)) {
10301030
unsigned I = 0;
10311031
for (; I < TokenNodes.size(); ++ I) {
10321032
auto Node = TokenNodes[I];

0 commit comments

Comments
 (0)