Problems with Xtext in eclipse

artaxerxe picture artaxerxe · Sep 21, 2012 · Viewed 12.6k times · Source

I'm working on a Java project in eclipse. Trying to open a file through Ctrl+Mouse click, I got a popup that asked me if I want to add "Xtext nature to my project". I said ok. And now, I tried to put on a CSS file the following line:

@import "myfile.css";

as first line. But I get this error, because of Xtext Check (fast):

missing EOF at ';'.

Can anybody help me on how to deal with this kind of error?

Thanks.

Answer

Zoltán Ujhelyi picture Zoltán Ujhelyi · Sep 22, 2012

You have two ways to solve this issue:

  1. First, you could uninstall the plug-in contributing the CssDsl editor. A quick Google search told me that it is contributed by the e(fx)Eclipse plugins. To uninstall a plug-in, go to the About dialog, click on the Installation details feature, and in the upcoming dialog you could look for the feature to uninstall.

  2. If the previous solution does not work for you (e.g. you need the e(fx)Eclipse environment), you have to change the default file associations to avoid opening css files with the Xtext-based editor, and remove the Xtext nature from the projects you added.

    1. Setting file associations: open Eclipse Preferences, navigate to the General->Editors -> File Associations page, where you can look for the CSS extension, and select a different default editor for it.
    2. Removing the Xtext nature: you can right click on your project, and select Configure -> Remove Xtext nature. If that does not work for some reason, you have to open the hidden .project file, and remove the <nature>org.eclipse.xtext.ui.shared.xtextNature</nature> entry and the corresponding org.eclipse.xtext.ui.shared.xtextBuilder buildCommand manually.