avatar

Xtext and more

  • Impressum

Xtext Content Assist Auto Activation

September 19, 2011 · Christian Dietrich · Tags: Auto Activation , Content Assist , Xtext

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 :

© 2023 - Powered by Hugo with the Type Theme