Disable "Add Xtext nature" dialog in Eclipse
Asked Answered
M

1

9

I'm using a custom DSL with Xtext grammar. In my workspace there are several projects, one of them is the development relevant project, another one is for testing purposes.

In the testing project there are a lot (> 5000) of files of my DSL, required for JUnit tests.

When the Xtext nature is added to this project, rebuilding it takes a long time, so I removed it. It's not important to me in the project anyways. But now everytime I open one of the files, Xtext asks me to add the nature to this project.

Can I disable this dialog, for a specific project or in general?

Thanks for answers!

Minuteman answered 20/7, 2012 at 9:41 Comment(1)
This annoying feature went away for me once I removed the E4 CSS plugin.Proliferation
A
5

I believe, the NatureAddingEditorCallback class is responsible for that feature.

To replace this functionality for your language, I would try the following: Open the «LanguageName»UiModule class from your UI project (be careful, it is in the src folder; an abstract version is in the src-gen folder), and add the following lines (this piece of code came from the XtextUIModule class):

public Class<? extends IXtextEditorCallback> bindIXtextEditorCallback() {
    return org.eclipse.xtext.builder.nature.NatureAddingEditorCallback.class;
}

Then replace the returned class with your own.

Acotyledon answered 24/7, 2012 at 22:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.