From f4c66837108d713bf8023b569f9ab350850b9364 Mon Sep 17 00:00:00 2001
From: dgelessus <dgelessus@users.noreply.github.com>
Date: Tue, 16 Jun 2020 22:29:51 +0200
Subject: [PATCH] Remove unnecessary special case in inspection/completion

If the cursor is after the command name, but before the start of the
argument string, it makes more sense from a user perspective to treat
it as if it was at the start of the argument string. This way if there
are multiple spaces between the command name and argument, the user can
still use code completion inside this whitespace and get completions
for the first parameter of the command.
---
 src/main/java/de/prob2/jupyter/ProBKernel.java | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/src/main/java/de/prob2/jupyter/ProBKernel.java b/src/main/java/de/prob2/jupyter/ProBKernel.java
index bde37e6..95e5c69 100644
--- a/src/main/java/de/prob2/jupyter/ProBKernel.java
+++ b/src/main/java/de/prob2/jupyter/ProBKernel.java
@@ -443,9 +443,6 @@ public final class ProBKernel extends BaseKernel {
 			if (at <= split.getName().getEndPosition()) {
 				// The cursor is somewhere in the command name, show help text for the command.
 				return command.renderHelp();
-			} else if (at < split.getArgString().getStartPosition()) {
-				// The cursor is in the whitespace between the command name and arguments, don't show anything.
-				return null;
 			} else {
 				// The cursor is somewhere in the command arguments, ask the command to inspect.
 				return inspectCommandArguments(command, split.getArgString(), at);
@@ -513,9 +510,6 @@ public final class ProBKernel extends BaseKernel {
 				split.getName().getStartPosition(),
 				split.getName().getEndPosition()
 			);
-		} else if (at < split.getArgString().getStartPosition()) {
-			// The cursor is in the whitespace between the command name and arguments, don't show anything.
-			return null;
 		} else {
 			// The cursor is somewhere in the command arguments, ask the command to provide completions.
 			if (this.getCommands().containsKey(split.getName().getValue())) {
-- 
GitLab