From adcb9f7f661633b5559b9df3f941cfe1f950b65f Mon Sep 17 00:00:00 2001 From: cleem Date: Fri, 13 Mar 2015 12:22:32 +0300 Subject: [PATCH] Fix getDoc range violation --- src/autocomplete.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/autocomplete.d b/src/autocomplete.d index 50b975c..8898b7f 100644 --- a/src/autocomplete.d +++ b/src/autocomplete.d @@ -59,7 +59,7 @@ public AutocompleteResponse getDoc(const AutocompleteRequest request) allocator, &cache); if (symbols.length == 0) 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); return response; } @@ -1187,7 +1187,7 @@ string formatComment(string comment) enum tripleSlashRegex = `(?:\t )*///`; enum slashStarRegex = `(?:^/\*\*+)|(?:\n?\s*\*+/$)|(?:(?<=\n)\s*\* ?)`; enum slashPlusRegex = `(?:^/\+\++)|(?:\n?\s*\++/$)|(?:(?<=\n)\s*\+ ?)`; - if (comment is null) + if (comment.length < 3) return null; string re; if (comment[0 .. 3] == "///")