mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[IDE/SyntaxModel] Make sure to properly annotate comment markers in single-line comment blocks
rdar://51893731
This commit is contained in:
@@ -1272,6 +1272,10 @@ bool ModelASTWalker::processComment(CharSourceRange Range) {
|
||||
if (NewLinePos != StringRef::npos) {
|
||||
Text = Text.substr(0, NewLinePos);
|
||||
}
|
||||
if (Text.endswith("*/")) {
|
||||
Text = Text.drop_back(2);
|
||||
}
|
||||
Text = Text.rtrim();
|
||||
|
||||
CharSourceRange BeforeMarker{ SM, Range.getStart(), Loc };
|
||||
CharSourceRange Marker(Loc, Text.size());
|
||||
|
||||
Reference in New Issue
Block a user