FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Handle replaceStart/replaceEnd in completion proposal by mfussenegger · Pull Request #526 · microsoft/java-debug · GitHub

Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .java  (1) .target  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,16 @@ public CompletionItem toCompletionItem(CompletionProposal proposal, int index) {
data.put(CompletionResolveHandler.DATA_FIELD_REQUEST_ID, String.valueOf(response.getId()));
data.put(CompletionResolveHandler.DATA_FIELD_PROPOSAL_ID, String.valueOf(index));
$.setData(data);

this.descriptionProvider.updateDescription(proposal, $);
// Use fully qualified name as needed.
$.setInsertText(String.valueOf(proposal.getCompletion()));
String insertText = String.valueOf(proposal.getCompletion());
int prefix = proposal.getReplaceEnd() - proposal.getReplaceStart();
if (prefix > 0) {
$.setInsertText(insertText.substring(prefix));
} else {
$.setInsertText(insertText);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

this doesn't work for VS Code. Typing Sys to trigger completion, select System and it becomes tem.

adjustCompleteItem($);
$.setSortText(SortTextHelper.computeSortText(proposal));
return $;
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<unit id="org.eclipse.jdt.source.feature.group" version="0.0.0"/>
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
<unit id="org.eclipse.xtext.sdk.feature.group" version="0.0.0"/>
<repository location="https://download.eclipse.org/releases/2023-12/202311171000/"/>
<repository location="https://download.eclipse.org/releases/2023-12/202312061001/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.jboss.tools.maven.apt.core" version="0.0.0"/>
Expand All @@ -32,4 +32,4 @@
<unit id="org.eclipse.lsp4j.sdk.feature.group" version="0.0.0"/>
</location>
</locations>
</target>
</target>

Back | FazBrowse Home | New Git URL