Skip to content
This repository has been archived by the owner on Apr 3, 2018. It is now read-only.

Commit

Permalink
Fixed #86 - Content Assist auto triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-medeiros committed Jun 5, 2015
1 parent f2772e0 commit 8a421b4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 43 deletions.
1 change: 1 addition & 0 deletions documentation/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ A less intrusive message is shown in the bottom of the workbench window.
* Reworked Content Assist preference page. Now has option to auto-activate with alphabet characters.
* Fixed #91: `Tab policy: "Spaces Only"` preference ignored when pressing TAB.
* Added: Parsing of `return ref` added in D 2.067.0.
* Fixed #86: ";" doesn't get inserted if Content Assist is open

* Upgraded minimum Java version to Java 8
* Added: Show error message dialog if starting Eclipse with a Java version below the minimum.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@
import _org.eclipse.dltk.ui.PreferenceConstants;


/* FIXME: DLTK review this code*/
/* TODO: DLTK review this code*/
public abstract class AbstractScriptCompletionProposal extends LangCompletionProposal {

protected char[] fTriggerCharacters;

protected StyleRange fRememberedStyleRange;


Expand All @@ -47,23 +45,6 @@ public AbstractScriptCompletionProposal(ToolCompletionProposal proposal, String
super(proposal, additionalProposalInfo, image, contextInformation);
}

@Override
public char[] getTriggerCharacters() {
return fTriggerCharacters;
}

/**
* Sets the trigger characters.
*
* @param triggerCharacters
* The set of characters which can trigger the application of
* this completion proposal
*/
public void setTriggerCharacters(char[] triggerCharacters) {
fTriggerCharacters = triggerCharacters;
}


/* --------------------------------- */

/** The CSS used to format javadoc information. */
Expand All @@ -79,10 +60,8 @@ protected String getCSSStyles() {

@Override
public Object getAdditionalProposalInfo(IProgressMonitor monitor) {
//if (getProposalInfo() != null) {
String info= getProposalInfoString(monitor);
return HoverUtil.getCompleteHoverInfo(info, getCSSStyles());
//}
String info= getProposalInfoString(monitor);
return HoverUtil.getCompleteHoverInfo(info, getCSSStyles());
}

protected abstract String getProposalInfoString(IProgressMonitor monitor);
Expand All @@ -92,20 +71,10 @@ public Object getAdditionalProposalInfo(IProgressMonitor monitor) {
/* ----------------- ----------------- */


/**
* Gets the replacement offset.
*
* @return Returns a int
*/
public int getReplacementOffset() {
return getReplaceOffset();
}

/**
* Gets the replacement length.
*
* @return Returns a int
*/
public int getReplacementLength() {
return getReplaceLength();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,11 @@ public List<IContextInformation> computeContextInformation(SourceOperationContex

/* ----------------- ----------------- */

protected final static char[] VAR_TRIGGER = { ' ', '=', ';' };

protected static char[] getVarTrigger() {
return VAR_TRIGGER;
}

@Override
public DeeContentAssistProposal adaptToolProposal(ToolCompletionProposal proposal) {
Image image = getImage(proposal);

DeeContentAssistProposal completionProposal = new DeeContentAssistProposal(proposal, image);
completionProposal.setTriggerCharacters(getVarTrigger());
return completionProposal;
return new DeeContentAssistProposal(proposal, image);
}

@Override
Expand Down

0 comments on commit 8a421b4

Please sign in to comment.