From 3ea524179d6566e6723a134273e2886a974596e0 Mon Sep 17 00:00:00 2001 From: ryuukk <44361234+ryuukk@users.noreply.github.com> Date: Wed, 15 Nov 2023 13:11:16 +0100 Subject: [PATCH] Allow parsing the whole module --- dsymbol/src/dsymbol/conversion/package.d | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dsymbol/src/dsymbol/conversion/package.d b/dsymbol/src/dsymbol/conversion/package.d index 6b0df506..5c1dc75c 100644 --- a/dsymbol/src/dsymbol/conversion/package.d +++ b/dsymbol/src/dsymbol/conversion/package.d @@ -115,7 +115,7 @@ class AutocompleteParser : Parser { if (!currentIs(tok!"{")) return null; - if (current.index > cursorPosition) + if (cursorPosition != -1 && current.index > cursorPosition) { BlockStatement bs = allocator.make!(BlockStatement); bs.startLocation = current.index; @@ -126,7 +126,7 @@ class AutocompleteParser : Parser immutable start = current.index; auto b = setBookmark(); skipBraces(); - if (tokens[index - 1].index < cursorPosition) + if (cursorPosition != -1 && tokens[index - 1].index < cursorPosition) { abandonBookmark(b); BlockStatement bs = allocator.make!BlockStatement(); @@ -142,7 +142,7 @@ class AutocompleteParser : Parser } private: - size_t cursorPosition; + long cursorPosition; } class SimpleParser : Parser