| Extended highlighting breaks embedded editor highlighting [message #989782] |
Fri, 07 December 2012 12:59  |
Gaspar Din Messages: 21 Registered: September 2012 |
Junior Member |
|
|
Hello,
I need some help with the embedded editor and syntax highlighting.
Extending the highlighting with this two implementations
public Class<? extends IHighlightingConfiguration> bindIHighlightingConfiguration() {
return MyDslHighlightingConfiguration.class;
}
public Class<? extends ISemanticHighlightingCalculator> bindSemanticHighlightingCalculator() {
return MyDslHighlightingCalculator.class;
}
ends in no syntax highlighting in the embedded editor (neither the base highlighting nor the extra highlighting) while the "regular" (file based) editor shows the highlighting (including the extra highlighting).
Has anybody some ideas to fix this?
Regards,
Gaspar
|
|
|
|
| Re: Extended highlighting breaks embedded editor highlighting [message #989997 is a reply to message #989795] |
Mon, 10 December 2012 06:46  |
Gaspar Din Messages: 21 Registered: September 2012 |
Junior Member |
|
|
Hi Christian,
yes there is an own ViewerConfiguration
public class ViewerConfiguration {
public ViewerConfiguration() {
Injector injector = MyDslActivator.getInstance().getInjector(MyDslActivator.COM_MYDSL);
editorFactory = injector.getInstance(EmbeddedEditorFactory.class);
dialogSettings = injector.getInstance(IDialogSettings.class);
highlightingHelper = injector.getInstance(HighlightingHelper.class);
}
@Inject
private IDialogSettings dialogSettings;
@Inject
private EmbeddedEditorFactory editorFactory;
@Inject
private HighlightingHelper highlightingHelper;
public IDialogSettings getDialogSettings() {
return dialogSettings;
}
public void setDialogSettings(IDialogSettings dialogSettings) {
this.dialogSettings = dialogSettings;
}
public EmbeddedEditorFactory getEmbeddedEditorFactory() {
return editorFactory;
}
public void setEmbeddedEditorFactory(EmbeddedEditorFactory factory) {
this.editorFactory = factory;
}
public HighlightingHelper getHighlightingHelper() {
return highlightingHelper;
}
public void setHighlightingHelper(HighlightingHelper highlightingHelper) {
this.highlightingHelper = highlightingHelper;
}
}
and it is called:
EmbeddedEditorFactory factory = injector.getInstance(EmbeddedEditorFactory.class);
IResourceValidator resourceValidator = injector.getInstance(IResourceValidator.class);
embeddedEditor = factory.newEditor(resourceProvider).showErrorAndWarningAnnotations().withResourceValidator(resourceValidator).withParent(parent);
configuration.getHighlightingHelper().install(embeddedEditor.getConfiguration(), embeddedEditor.getViewer());
One difference: the call is not performed in the method createPartControl(..) as my class does not implement IWorkbenchPart.
But I don't think this is causing the incorrect behaviour?
Regards,
Gaspar
|
|
|
Powered by
FUDForum. Page generated in 0.02062 seconds