This commit is contained in:
Martin Lippert
2024-06-20 10:58:56 +02:00
parent eaaa754d0c
commit ccb2f1a2e0
4 changed files with 0 additions and 25 deletions

View File

@@ -70,9 +70,6 @@ public class DependsOnCompletionProcessor implements CompletionProvider {
DocumentEdits edits = new DocumentEdits(doc, false);
edits.replace(offset, offset, "\"" + bean.getName() + "\"");
// PT-160455522: create a proposal with `PlainText` format type, because for vscode (but not Eclipse), if you send it as a snippet
// and it is "place holder" as such `"${debug}"`, vscode may treat it as a snippet place holder, and insert an empty string
// if it cannot resolve it. If sending this as plain text, then insertion happens correctly
DependsOnCompletionProposal proposal = new DependsOnCompletionProposal(edits, bean.getName(), bean.getName(), null);
completions.add(proposal);
@@ -137,9 +134,6 @@ public class DependsOnCompletionProcessor implements CompletionProvider {
DocumentEdits edits = new DocumentEdits(doc, false);
edits.replace(startOffset, endOffset, proposalPrefix + bean.getName() + proposalPostfix);
// PT-160455522: create a proposal with `PlainText` format type, because for vscode (but not Eclipse), if you send it as a snippet
// and it is "place holder" as such `"${debug}"`, vscode may treat it as a snippet place holder, and insert an empty string
// if it cannot resolve it. If sending this as plain text, then insertion happens correctly
DependsOnCompletionProposal proposal = new DependsOnCompletionProposal(edits, bean.getName(), bean.getName(), null);
completions.add(proposal);
@@ -168,9 +162,6 @@ public class DependsOnCompletionProcessor implements CompletionProvider {
DocumentEdits edits = new DocumentEdits(doc, false);
edits.replace(startOffset, endOffset, bean.getName());
// PT-160455522: create a proposal with `PlainText` format type, because for vscode (but not Eclipse), if you send it as a snippet
// and it is "place holder" as such `"${debug}"`, vscode may treat it as a snippet place holder, and insert an empty string
// if it cannot resolve it. If sending this as plain text, then insertion happens correctly
DependsOnCompletionProposal proposal = new DependsOnCompletionProposal(edits, bean.getName(), bean.getName(), null);
completions.add(proposal);
@@ -190,9 +181,6 @@ public class DependsOnCompletionProcessor implements CompletionProvider {
DocumentEdits edits = new DocumentEdits(doc, false);
edits.replace(offset, offset, "\"" + bean.getName() + "\"");
// PT-160455522: create a proposal with `PlainText` format type, because for vscode (but not Eclipse), if you send it as a snippet
// and it is "place holder" as such `"${debug}"`, vscode may treat it as a snippet place holder, and insert an empty string
// if it cannot resolve it. If sending this as plain text, then insertion happens correctly
DependsOnCompletionProposal proposal = new DependsOnCompletionProposal(edits, bean.getName(), bean.getName(), null);
completions.add(proposal);
@@ -217,9 +205,6 @@ public class DependsOnCompletionProcessor implements CompletionProvider {
DocumentEdits edits = new DocumentEdits(doc, false);
edits.replace(offset, offset, "\"" + bean.getName() + "\",");
// PT-160455522: create a proposal with `PlainText` format type, because for vscode (but not Eclipse), if you send it as a snippet
// and it is "place holder" as such `"${debug}"`, vscode may treat it as a snippet place holder, and insert an empty string
// if it cannot resolve it. If sending this as plain text, then insertion happens correctly
DependsOnCompletionProposal proposal = new DependsOnCompletionProposal(edits, bean.getName(), bean.getName(), null);
completions.add(proposal);

View File

@@ -30,9 +30,6 @@ public class DependsOnCompletionProposal implements ICompletionProposal {
public DependsOnCompletionProposal(DocumentEdits edits, String label, String detail, Renderable documentation) {
this.edits = edits;
this.label = label;
// PT 161489998 - Detail for proposal must not be null. For some clients like Eclipse,
// a null detail results in an NPE at JDT level when inserting the proposal in the editor, and results
// in odd behaviour like insertion of an extra new line.
this.detail = detail == null ? EMPTY_DETAIL : detail;
this.documentation = documentation;
}

View File

@@ -165,11 +165,7 @@ public class QualifierCompletionProcessor implements CompletionProvider {
DocumentEdits edits = new DocumentEdits(doc, false);
edits.replace(startOffset, endOffset, createReplacementText.apply(candidate));
// PT-160455522: create a proposal with `PlainText` format type, because for vscode (but not Eclipse), if you send it as a snippet
// and it is "place holder" as such `"${debug}"`, vscode may treat it as a snippet place holder, and insert an empty string
// if it cannot resolve it. If sending this as plain text, then insertion happens correctly
QualifierCompletionProposal proposal = new QualifierCompletionProposal(edits, candidate, candidate, null, score--);
completions.add(proposal);
}
}

View File

@@ -31,9 +31,6 @@ public class QualifierCompletionProposal extends ScoreableProposal {
public QualifierCompletionProposal(DocumentEdits edits, String label, String detail, Renderable documentation, double score) {
this.edits = edits;
this.label = label;
// PT 161489998 - Detail for proposal must not be null. For some clients like Eclipse,
// a null detail results in an NPE at JDT level when inserting the proposal in the editor, and results
// in odd behaviour like insertion of an extra new line.
this.detail = detail == null ? EMPTY_DETAIL : detail;
this.documentation = documentation;
this.score = score;