From c103417caeff7f2d4bdd74d1bf35427afe97047d Mon Sep 17 00:00:00 2001 From: Atila Neves Date: Tue, 16 Jun 2015 12:08:08 +0200 Subject: [PATCH 1/3] Fixing range error bug --- src/autocomplete.d | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/autocomplete.d b/src/autocomplete.d index d0e4941..9c610d4 100644 --- a/src/autocomplete.d +++ b/src/autocomplete.d @@ -229,10 +229,13 @@ AutocompleteResponse dotCompletion(T)(T beforeTokens, // responses when the cursor is in the middle of an identifier instead // of at the end auto t = beforeTokens[$ - 1]; - partial = t.text[0 .. cursorPosition - t.index]; + if (cursorPosition - t.index >= 0 && cursorPosition - t.index < t.text.length) + { + partial = t.text[0 .. cursorPosition - t.index]; - significantTokenType = tok!"identifier"; - beforeTokens = beforeTokens[0 .. $ - 1]; + significantTokenType = tok!"identifier"; + beforeTokens = beforeTokens[0 .. $ - 1]; + } } else if (beforeTokens.length >= 2 && beforeTokens[$ - 1] == tok!".") significantTokenType = beforeTokens[$ - 2].type; From 42ca903215017fb436f4226d31d5744a197f427f Mon Sep 17 00:00:00 2001 From: Atila Neves Date: Tue, 30 Jun 2015 14:40:45 +0200 Subject: [PATCH 2/3] Fix autocomplete bug introduced by c5c342d --- src/autocomplete.d | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/autocomplete.d b/src/autocomplete.d index 9c610d4..40b276d 100644 --- a/src/autocomplete.d +++ b/src/autocomplete.d @@ -229,13 +229,13 @@ AutocompleteResponse dotCompletion(T)(T beforeTokens, // responses when the cursor is in the middle of an identifier instead // of at the end auto t = beforeTokens[$ - 1]; - if (cursorPosition - t.index >= 0 && cursorPosition - t.index < t.text.length) + if (cursorPosition - t.index >= 0 && cursorPosition - t.index <= t.text.length) { partial = t.text[0 .. cursorPosition - t.index]; - - significantTokenType = tok!"identifier"; - beforeTokens = beforeTokens[0 .. $ - 1]; } + + significantTokenType = tok!"identifier"; + beforeTokens = beforeTokens[0 .. $ - 1]; } else if (beforeTokens.length >= 2 && beforeTokens[$ - 1] == tok!".") significantTokenType = beforeTokens[$ - 2].type; From 7b8354debb5907fd93249cb3783639d092f81c3a Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 23 Jul 2015 21:05:44 -0400 Subject: [PATCH 3/3] Fix spelling of classinfo. The classinfo property was mispelled as classInfo in actypes.d, resulting in incorrect completions. See: http://dlang.org/property.html#classinfo --- src/actypes.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/actypes.d b/src/actypes.d index 410f7cd..c7e3165 100644 --- a/src/actypes.d +++ b/src/actypes.d @@ -689,7 +689,7 @@ static this() aggregateSymbols.insert(stringof_); aggregateSymbols.insert(init); - classSymbols.insert(allocate!ACSymbol(Mallocator.it, internString("classInfo"), CompletionKind.variableName)); + classSymbols.insert(allocate!ACSymbol(Mallocator.it, internString("classinfo"), CompletionKind.variableName)); classSymbols.insert(allocate!ACSymbol(Mallocator.it, internString("tupleof"), CompletionKind.variableName)); classSymbols.insert(allocate!ACSymbol(Mallocator.it, internString("__vptr"), CompletionKind.variableName)); classSymbols.insert(allocate!ACSymbol(Mallocator.it, internString("__monitor"), CompletionKind.variableName));