File tree Expand file tree Collapse file tree
test/unit-test/member_chain Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -193,7 +193,8 @@ function handleMemberChainComments(commentNode: CommentNode) {
193193 ( enclosingNode ?. type === SyntaxType . FieldAccess ||
194194 ( enclosingNode ?. type === SyntaxType . MethodInvocation &&
195195 precedingNode ?. end . row !== commentNode . start . row ) ) &&
196- followingNode ?. type === SyntaxType . Identifier
196+ ( followingNode ?. type === SyntaxType . Identifier ||
197+ followingNode ?. type === SyntaxType . TypeArguments )
197198 ) {
198199 util . addLeadingComment ( enclosingNode , commentNode ) ;
199200 return true ;
Original file line number Diff line number Diff line change @@ -112,6 +112,14 @@ public void doSomethingWithComment() {
112112 .something ().more ();
113113 }
114114
115+ public void genericMethodWithLeadingComment () {
116+ a
117+ // 1
118+ .b ()
119+ // 2
120+ .<C >c ();
121+ }
122+
115123 public void doSomethingLongNew () {
116124 return something ().more ().and ().that ().as ().well ().but ().not ().something ().something ();
117125 }
Original file line number Diff line number Diff line change @@ -119,6 +119,14 @@ public void doSomethingWithComment() {
119119 .more ();
120120 }
121121
122+ public void genericMethodWithLeadingComment () {
123+ a
124+ // 1
125+ .b ()
126+ // 2
127+ .<C >c ();
128+ }
129+
122130 public void doSomethingLongNew () {
123131 return something ()
124132 .more ()
You can’t perform that action at this time.
0 commit comments