diff --git a/.project b/.project
index f659e76ef..d34865de3 100644
--- a/.project
+++ b/.project
@@ -14,4 +14,15 @@
org.eclipse.m2e.core.maven2Nature
+
+
+ 1600224298170
+
+ 30
+
+ org.eclipse.core.resources.regexFilterMatcher
+ node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__
+
+
+
diff --git a/com.microsoft.java.debug.core/.project b/com.microsoft.java.debug.core/.project
index 773c5b793..a7480133e 100644
--- a/com.microsoft.java.debug.core/.project
+++ b/com.microsoft.java.debug.core/.project
@@ -26,4 +26,15 @@
net.sf.eclipsecs.core.CheckstyleNature
org.eclipse.m2e.core.maven2Nature
+
+
+ 1599036548523
+
+ 30
+
+ org.eclipse.core.resources.regexFilterMatcher
+ node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__
+
+
+
diff --git a/com.microsoft.java.debug.plugin/.project b/com.microsoft.java.debug.plugin/.project
index b7a152d24..72ba17ff7 100644
--- a/com.microsoft.java.debug.plugin/.project
+++ b/com.microsoft.java.debug.plugin/.project
@@ -37,4 +37,15 @@
org.eclipse.pde.PluginNature
org.eclipse.jdt.core.javanature
+
+
+ 1599036548577
+
+ 30
+
+ org.eclipse.core.resources.regexFilterMatcher
+ node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__
+
+
+
diff --git a/com.microsoft.java.debug.plugin/src/main/java/com/microsoft/java/debug/plugin/internal/CompletionsProvider.java b/com.microsoft.java.debug.plugin/src/main/java/com/microsoft/java/debug/plugin/internal/CompletionsProvider.java
index bf5131344..3b9680017 100644
--- a/com.microsoft.java.debug.plugin/src/main/java/com/microsoft/java/debug/plugin/internal/CompletionsProvider.java
+++ b/com.microsoft.java.debug.plugin/src/main/java/com/microsoft/java/debug/plugin/internal/CompletionsProvider.java
@@ -69,7 +69,8 @@ public List codeComplete(StackFrame frame, String snippet, int l
collector.setAllowsRequiredProposals(CompletionProposal.TYPE_REF, CompletionProposal.TYPE_REF, true);
- type.codeComplete(snippet.toCharArray(), offset, snippet.length(), null, null, null, frame.location().method().isStatic(), collector);
+ int position = getInsertPosition(snippet, line, column);
+ type.codeComplete(snippet.toCharArray(), offset, position, null, null, null, frame.location().method().isStatic(), collector);
List items = collector.getCompletionItems();
@@ -87,6 +88,17 @@ public List codeComplete(StackFrame frame, String snippet, int l
return res;
}
+ private int getInsertPosition(String snippet, int line, int column) {
+ int lineInSnippet = context.isClientLinesStartAt1() ? line - 1 : line;
+ int offsetInSnippet = -1;
+ for (int i = 0; i < lineInSnippet; i++) {
+ offsetInSnippet = snippet.indexOf('\n', offsetInSnippet + 1);
+ }
+
+ offsetInSnippet++;
+ return offsetInSnippet + column + (context.isClientColumnsStartAt1() ? -1 : 0);
+ }
+
private IType resolveType(StackFrame frame) throws CoreException, DebugException {
ISourceLookUpProvider sourceProvider = context.getProvider(ISourceLookUpProvider.class);
if (sourceProvider instanceof JdtSourceLookUpProvider) {
diff --git a/com.microsoft.java.debug.repository/.project b/com.microsoft.java.debug.repository/.project
index 42d872c95..887e4a7a8 100644
--- a/com.microsoft.java.debug.repository/.project
+++ b/com.microsoft.java.debug.repository/.project
@@ -14,4 +14,15 @@
org.eclipse.m2e.core.maven2Nature
+
+
+ 1600224298119
+
+ 30
+
+ org.eclipse.core.resources.regexFilterMatcher
+ node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__
+
+
+