Fix getDoc range violation

This commit is contained in:
cleem 2015-03-13 12:22:32 +03:00
parent b89a5c8b4c
commit adcb9f7f66
1 changed files with 2 additions and 2 deletions

View File

@ -59,7 +59,7 @@ public AutocompleteResponse getDoc(const AutocompleteRequest request)
allocator, &cache); allocator, &cache);
if (symbols.length == 0) if (symbols.length == 0)
Log.error("Could not find symbol"); Log.error("Could not find symbol");
else foreach (symbol; symbols.filter!(a => a.doc !is null)) else foreach (symbol; symbols.filter!(a => !a.doc.empty))
response.docComments ~= formatComment(symbol.doc); response.docComments ~= formatComment(symbol.doc);
return response; return response;
} }
@ -1187,7 +1187,7 @@ string formatComment(string comment)
enum tripleSlashRegex = `(?:\t )*///`; enum tripleSlashRegex = `(?:\t )*///`;
enum slashStarRegex = `(?:^/\*\*+)|(?:\n?\s*\*+/$)|(?:(?<=\n)\s*\* ?)`; enum slashStarRegex = `(?:^/\*\*+)|(?:\n?\s*\*+/$)|(?:(?<=\n)\s*\* ?)`;
enum slashPlusRegex = `(?:^/\+\++)|(?:\n?\s*\++/$)|(?:(?<=\n)\s*\+ ?)`; enum slashPlusRegex = `(?:^/\+\++)|(?:\n?\s*\++/$)|(?:(?<=\n)\s*\+ ?)`;
if (comment is null) if (comment.length < 3)
return null; return null;
string re; string re;
if (comment[0 .. 3] == "///") if (comment[0 .. 3] == "///")