mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[IDE] Handle '@unknown' attribute in syntax map
`@unknown` is so far the only attribute for statement. Handle it specially in syntax-map. rdar://problem/47855035 / https://bugs.swift.org/browse/SR-9873
This commit is contained in:
@@ -67,8 +67,10 @@ SyntaxModelContext::SyntaxModelContext(SourceFile &SrcFile)
|
||||
Optional<unsigned> Length;
|
||||
if (AttrLoc.isValid()) {
|
||||
// This token is following @, see if it's a known attribute name.
|
||||
// Type attribute, decl attribute, or '@unknown' for swift case statement.
|
||||
if (TypeAttributes::getAttrKindFromString(Tok.getText()) != TAK_Count ||
|
||||
DeclAttribute::getAttrKindFromString(Tok.getText()) != DAK_Count) {
|
||||
DeclAttribute::getAttrKindFromString(Tok.getText()) != DAK_Count ||
|
||||
Tok.getText() == "unknown") {
|
||||
// It's a known attribute, so treat it as a syntactic attribute node for
|
||||
// syntax coloring. If swift gets user attributes then all identifiers
|
||||
// will be treated as syntactic attribute nodes.
|
||||
|
||||
Reference in New Issue
Block a user