|
|
Re: Delay of Content Assist Autoactivation [message #1800892 is a reply to message #1800872] |
Wed, 09 January 2019 08:23  |
Eclipse User |
|
|
|
Thank you very much Christian, that worked perfectly.
If anyone want a detailed step-by-step, I did the following:
Create my own content assistant factory where I change the preferences of the assistant:
package ...;
import org.eclipse.jface.text.contentassist.ContentAssistant;
import org.eclipse.xtext.ui.editor.contentassist.DefaultContentAssistantFactory;
public class MyDSLCustomContentAssistantFactory
extends DefaultContentAssistantFactory {
@Override
protected void loadPreferences(ContentAssistant assistant) {
assistant.setAutoActivationDelay(100); // in ms (default: 500 ms)
}
}
And then, in the ui module class, bind the new factory overriding the DefaultContentAssistantFactory one:
package ...;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.xtext.ui.editor.contentassist.IContentAssistantFactory;
import org.eclipse.xtext.ui.editor.contentassist.XtextContentAssistProcessor;
import com.google.inject.Binder;
import [...].MyDSLCustomContentAssistantFactory;
/**
* Use this class to register components to be used within the IDE.
*/
public class MyDSLUiModule extends [...].AbstractMyDSLUiModule {
[...]
@Override
public Class<? extends IContentAssistantFactory> bindIContentAssistantFactory() {
return MyDSLCustomContentAssistantFactory.class;
}
}
Thanks again,
Alfonso
|
|
|
Powered by
FUDForum. Page generated in 1.08006 seconds