@@ -682,6 +682,47 @@ final class DeclarationTests: SyntaxHighlighterTestCase {
682682 ] )
683683 }
684684
685+ func testPropertyWithCommentedDidSet( ) {
686+ let components = highlighter. highlight ( """
687+ struct Hello {
688+ var property: Int {
689+ // Comment.
690+ didSet { }
691+ }
692+ }
693+ """ )
694+
695+ XCTAssertEqual ( components, [
696+ . token( " struct " , . keyword) ,
697+ . whitespace( " " ) ,
698+ . plainText( " Hello " ) ,
699+ . whitespace( " " ) ,
700+ . plainText( " { " ) ,
701+ . whitespace( " \n " ) ,
702+ . token( " var " , . keyword) ,
703+ . whitespace( " " ) ,
704+ . plainText( " property: " ) ,
705+ . whitespace( " " ) ,
706+ . token( " Int " , . type) ,
707+ . whitespace( " " ) ,
708+ . plainText( " { " ) ,
709+ . whitespace( " \n " ) ,
710+ . token( " // " , . comment) ,
711+ . whitespace( " " ) ,
712+ . token( " Comment. " , . comment) ,
713+ . whitespace( " \n " ) ,
714+ . token( " didSet " , . keyword) ,
715+ . whitespace( " " ) ,
716+ . plainText( " { " ) ,
717+ . whitespace( " " ) ,
718+ . plainText( " } " ) ,
719+ . whitespace( " \n " ) ,
720+ . plainText( " } " ) ,
721+ . whitespace( " \n " ) ,
722+ . plainText( " } " )
723+ ] )
724+ }
725+
685726 func testPropertyWithSetterAccessLevel( ) {
686727 let components = highlighter. highlight ( """
687728 struct Hello {
@@ -1305,6 +1346,7 @@ extension DeclarationTests {
13051346 ( " testGenericPropertyDeclaration " , testGenericPropertyDeclaration) ,
13061347 ( " testPropertyDeclarationWithWillSet " , testPropertyDeclarationWithWillSet) ,
13071348 ( " testPropertyDeclarationWithDidSet " , testPropertyDeclarationWithDidSet) ,
1349+ ( " testPropertyWithCommentedDidSet " , testPropertyWithCommentedDidSet) ,
13081350 ( " testPropertyWithSetterAccessLevel " , testPropertyWithSetterAccessLevel) ,
13091351 ( " testPropertyDeclarationAfterCommentEndingWithVarKeyword " , testPropertyDeclarationAfterCommentEndingWithVarKeyword) ,
13101352 ( " testPropertyDeclarationWithStaticPropertyDefaultValue " , testPropertyDeclarationWithStaticPropertyDefaultValue) ,
0 commit comments