|
| 1 | +/******************************************************************************* |
| 2 | + * Copyright (c) 2025 Broadcom Inc. and others. |
| 3 | + * This program and the accompanying materials are made |
| 4 | + * available under the terms of the Eclipse Public License 2.0 |
| 5 | + * which is available at https://www.eclipse.org/legal/epl-2.0/ |
| 6 | + * |
| 7 | + * SPDX-License-Identifier: EPL-2.0 |
| 8 | + * |
| 9 | + * Contributors: |
| 10 | + * - Alex Boyko (Broadcom Inc.) - Initial implementation |
| 11 | + *******************************************************************************/ |
| 12 | +package org.eclipse.lsp4e.jdt; |
| 13 | + |
| 14 | +import org.eclipse.jdt.annotation.Nullable; |
| 15 | +import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal; |
| 16 | +import org.eclipse.jface.text.IDocument; |
| 17 | +import org.eclipse.jface.text.contentassist.ICompletionProposal; |
| 18 | +import org.eclipse.jface.text.contentassist.IContextInformation; |
| 19 | +import org.eclipse.swt.graphics.Image; |
| 20 | +import org.eclipse.swt.graphics.Point; |
| 21 | + |
| 22 | +class LSJavaCompletionWrappingCompletionProposal implements IJavaCompletionProposal { |
| 23 | + |
| 24 | + private final ICompletionProposal delegate; |
| 25 | + |
| 26 | + public LSJavaCompletionWrappingCompletionProposal(ICompletionProposal delegate) { |
| 27 | + this.delegate = delegate; |
| 28 | + } |
| 29 | + |
| 30 | + @Override |
| 31 | + public void apply(IDocument document) { |
| 32 | + delegate.apply(document); |
| 33 | + } |
| 34 | + |
| 35 | + @Override |
| 36 | + public @Nullable Point getSelection(IDocument document) { |
| 37 | + return delegate.getSelection(document); |
| 38 | + } |
| 39 | + |
| 40 | + @Override |
| 41 | + public @Nullable String getAdditionalProposalInfo() { |
| 42 | + return delegate.getAdditionalProposalInfo(); |
| 43 | + } |
| 44 | + |
| 45 | + @Override |
| 46 | + public String getDisplayString() { |
| 47 | + return delegate.getDisplayString(); |
| 48 | + } |
| 49 | + |
| 50 | + @Override |
| 51 | + public @Nullable Image getImage() { |
| 52 | + return delegate.getImage(); |
| 53 | + } |
| 54 | + |
| 55 | + @Override |
| 56 | + public @Nullable IContextInformation getContextInformation() { |
| 57 | + return delegate.getContextInformation(); |
| 58 | + } |
| 59 | + |
| 60 | + @Override |
| 61 | + public int getRelevance() { |
| 62 | + return -1; |
| 63 | + } |
| 64 | + |
| 65 | +} |
0 commit comments