Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,15 @@
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
<filteredResources>
<filter>
<id>1600224298170</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
11 changes: 11 additions & 0 deletions com.microsoft.java.debug.core/.project
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,15 @@
<nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
<filteredResources>
<filter>
<id>1599036548523</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
11 changes: 11 additions & 0 deletions com.microsoft.java.debug.plugin/.project
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,15 @@
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1599036548577</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ public List<CompletionItem> 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<org.eclipse.lsp4j.CompletionItem> items = collector.getCompletionItems();

Expand All @@ -87,6 +88,17 @@ public List<CompletionItem> 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) {
Expand Down
11 changes: 11 additions & 0 deletions com.microsoft.java.debug.repository/.project
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,15 @@
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
<filteredResources>
<filter>
<id>1600224298119</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>