Skip to content

Commit b6f4aa9

Browse files
committed
Fix wrong condition for unterminated multi-line comments
1 parent 3c32fcc commit b6f4aa9

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/services/services.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2025,9 +2025,9 @@ module ts {
20252025
return true;
20262026
}
20272027
else {
2028-
// is unterminated multiline comment
2029-
return text.charCodeAt(comment.end - 1) !== CharacterCodes.slash &&
2030-
text.charCodeAt(comment.end - 2) !== CharacterCodes.asterisk;
2028+
// is unterminated multi-line comment
2029+
return !(text.charCodeAt(comment.end - 1) === CharacterCodes.slash &&
2030+
text.charCodeAt(comment.end - 2) === CharacterCodes.asterisk);
20312031
}
20322032
}
20332033
return false;

tests/cases/fourslash/completionListInComments3.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
//// {| "name": "5" |}/* */
1212

13+
/////* {| "name": "6" |}
14+
1315
goTo.marker("1");
1416
verify.completionListIsEmpty();
1517

@@ -22,5 +24,8 @@ verify.completionListIsEmpty();
2224
goTo.marker("4");
2325
verify.not.completionListIsEmpty();
2426

25-
//goTo.marker("5");
26-
//verify.not.completionListIsEmpty();
27+
goTo.marker("5");
28+
verify.not.completionListIsEmpty();
29+
30+
goTo.marker("6");
31+
verify.completionListIsEmpty();

0 commit comments

Comments
 (0)