Skip to content

Commit 2538ae3

Browse files
authored
Merge pull request #25718 from akyrtzi/comment-marker-single-line-block
2 parents 54e59bf + dbc35b4 commit 2538ae3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/IDE/SyntaxModel.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,6 +1272,10 @@ bool ModelASTWalker::processComment(CharSourceRange Range) {
12721272
if (NewLinePos != StringRef::npos) {
12731273
Text = Text.substr(0, NewLinePos);
12741274
}
1275+
if (Text.endswith("*/")) {
1276+
Text = Text.drop_back(2);
1277+
}
1278+
Text = Text.rtrim();
12751279

12761280
CharSourceRange BeforeMarker{ SM, Range.getStart(), Loc };
12771281
CharSourceRange Marker(Loc, Text.size());

test/IDE/coloring_comments.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ func f(x: Int) -> Int {
3636

3737

3838

39-
/* FIXME: blah*/
39+
/* FIXME: blah */
4040

41-
// CHECK: <comment-block>/* <comment-marker>FIXME: blah*/</comment-marker></comment-block>
41+
// CHECK: <comment-block>/* <comment-marker>FIXME: blah</comment-marker> */</comment-block>
4242

4343
/*
4444
* FIXME: blah

0 commit comments

Comments
 (0)