From 8a421b4c3daaf53143904943eadae52db1068733 Mon Sep 17 00:00:00 2001 From: Bruno Medeiros Date: Fri, 5 Jun 2015 18:42:46 +0100 Subject: [PATCH] Fixed #86 - Content Assist auto triggers --- documentation/ChangeLog.md | 1 + .../AbstractScriptCompletionProposal.java | 37 ++----------------- .../DeeCompletionProposalComputer.java | 10 +---- 3 files changed, 5 insertions(+), 43 deletions(-) diff --git a/documentation/ChangeLog.md b/documentation/ChangeLog.md index 737fbc0c6..253494cb1 100644 --- a/documentation/ChangeLog.md +++ b/documentation/ChangeLog.md @@ -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. diff --git a/plugin_ide.ui/src-dltk-branch/_org/eclipse/dltk/ui/text/completion/AbstractScriptCompletionProposal.java b/plugin_ide.ui/src-dltk-branch/_org/eclipse/dltk/ui/text/completion/AbstractScriptCompletionProposal.java index d361fc332..78ac85378 100644 --- a/plugin_ide.ui/src-dltk-branch/_org/eclipse/dltk/ui/text/completion/AbstractScriptCompletionProposal.java +++ b/plugin_ide.ui/src-dltk-branch/_org/eclipse/dltk/ui/text/completion/AbstractScriptCompletionProposal.java @@ -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; @@ -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. */ @@ -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); @@ -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(); } diff --git a/plugin_ide.ui/src/mmrnmhrm/ui/editor/codeassist/DeeCompletionProposalComputer.java b/plugin_ide.ui/src/mmrnmhrm/ui/editor/codeassist/DeeCompletionProposalComputer.java index fb7ffa32f..0ab306e24 100644 --- a/plugin_ide.ui/src/mmrnmhrm/ui/editor/codeassist/DeeCompletionProposalComputer.java +++ b/plugin_ide.ui/src/mmrnmhrm/ui/editor/codeassist/DeeCompletionProposalComputer.java @@ -58,19 +58,11 @@ public List 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