mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-29 11:01:57 +00:00
[comments] Strip additional comment marker at the end of comments (#264)
This commit is contained in:
parent
63178468eb
commit
acc8f42033
@ -258,11 +258,13 @@ optional<std::string> ClangCursor::get_comments() const {
|
||||
clang_disposeString(cx_raw);
|
||||
while (ret.size() && isspace(ret.back()))
|
||||
ret.pop_back();
|
||||
if (ret.size() >= 2 && ret.compare(ret.size() - 2, 2, "*/") == 0) {
|
||||
if (EndsWith(ret, "*/")) {
|
||||
ret.resize(ret.size() - 2);
|
||||
} else if (EndsWith(ret, "\n/")) {
|
||||
ret.resize(ret.size() - 2);
|
||||
while (ret.size() && isspace(ret.back()))
|
||||
ret.pop_back();
|
||||
}
|
||||
while (ret.size() && isspace(ret.back()))
|
||||
ret.pop_back();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user