use of org.erlide.engine.services.codeassist.FunctionCompletionData in project erlide_eclipse by erlang.
the class AbstractErlContentAssistProcessor method toProposal.
protected ICompletionProposal toProposal(final CompletionData data) {
if (data instanceof FunctionCompletionData) {
final FunctionCompletionData fdata = (FunctionCompletionData) data;
String info = fdata.getAdditionalProposalInfo();
StringBuffer buffer = new StringBuffer(info == null ? "" : info);
return new ErlCompletionProposal(fdata.getOffsetsAndLengths(), fdata.getDisplayString(), fdata.getReplacementString(), fdata.getReplacementOffset(), fdata.getReplacementLength(), fdata.getCursorPosition(), null, null, HoverUtil.getHTML(buffer), sourceViewer);
}
return new CompletionProposal(data.getReplacementString(), data.getReplacementOffset(), data.getReplacementLength(), data.getCursorPosition());
}
use of org.erlide.engine.services.codeassist.FunctionCompletionData in project erlide_eclipse by erlang.
the class ErlangCompletionService method addFunctionCompletion.
protected void addFunctionCompletion(final int offset, final List<CompletionData> result, final String funWithArity, final String docStr, final String funWithParameters, final List<Location> offsetsAndLengths) {
int cursorPosition = funWithParameters.length();
if (!offsetsAndLengths.isEmpty()) {
cursorPosition = offsetsAndLengths.get(0).getOffset();
}
// first check if it's already there...
for (final CompletionData c : result) {
if (c.getDisplayString().equals(funWithArity)) {
return;
}
}
final CompletionData c = new FunctionCompletionData(offsetsAndLengths, funWithArity, funWithParameters, offset, 0, cursorPosition, docStr);
result.add(c);
}
Aggregations