Archive

Posts Tagged ‘Content Assist’

Xtext Content Assist Auto Activation

September 19, 2011 16 comments

Xtext offers nice Content Assist facilities. JDT offers a nice additional feature: Content assist is autoactivated if a certain character (.) is typed. To activate this feature in Xtext simply customize your UiModule

	
public class MyDslUiModule extends org.xtext.example.mydsl.ui.AbstractMyDslUiModule {
public MyDslUiModule(AbstractUIPlugin plugin) {
		super(plugin);
	}
	
	@Override
	public void configure(Binder binder) {
		super.configure(binder);
	binder.bind(String.class)
.annotatedWith(com.google.inject.name.Names.named(
(XtextContentAssistProcessor.COMPLETION_AUTO_ACTIVATION_CHARS)))
.toInstance(".,:");
	}
}

In this case content assist is autoactivated on . , and :

Advertisements