10

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.

artaxerxe
  • 6,281
  • 21
  • 68
  • 106
  • Please provide more information. Looks like you installed a plugin for editing CSS files that implemented in Xtext. – Sebastian Zarnekow Sep 21 '12 at 10:26
  • @SebastianZarnekow I think that's the problem (I have installed a CSS editoe plugin). But I don't know how to disable it or how to only find the plugin name. – artaxerxe Sep 21 '12 at 10:31
  • @SebastianZarnekow I found it. It is the CssDsl editor. Do you have any idea how to disable it? – artaxerxe Sep 21 '12 at 10:35
  • 1
    @artaxerxe, if this still matters to you, here is how to uninstall this plugin. Under Eclipse 'help => About Eclipse'; then 'installation detail' button; select plugin and click uninstall. – Alain Pannetier Apr 09 '13 at 04:37

2 Answers2

22

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.
blo0p3r
  • 6,790
  • 8
  • 49
  • 68
Zoltán Ujhelyi
  • 13,788
  • 2
  • 32
  • 37
  • I already did your second solution, but when I try to open a `css` file, I get this: *Unsupported content type in editor.To associate file extension with a supported content type, please see Content Types Preference Page* – artaxerxe Sep 24 '12 at 05:27
  • Maybe your environment remembered the editor to open the CSS file with. Try right clicking on it and selecting Open with, and select an existing, non-CssDsl editor. – Zoltán Ujhelyi Sep 24 '12 at 08:53
  • I want to edit css! What about fixing the problem? Isn't the real problem that you are trying to launch the plug-in. Does disabling it solve this problem? – Sinthia V Jul 14 '13 at 17:12
  • Well, the question was about a non-perfect alternative CSS editor. If you want to edit files without that error, you should turn off that editor, or report to its developer to fix the issue with their validators. – Zoltán Ujhelyi Jul 15 '13 at 09:03
  • After removing the Xtext nature, you may also have to manually delete the problem markers in the Markers view. ([This bug](https://bugs.eclipse.org/bugs/show_bug.cgi?id=345545) is supposed to be fixed, but it wasn't in the Eclipse version I'm using.) – Toper Sep 05 '13 at 20:45
  • @Toper your solution solved my problem very well, thanks . – Alter Hu Aug 19 '16 at 08:21
1

I had the same error, when I was creating CSS via New -> Other... -> Web -> CSS File.
Zoltan's solutions did not work, but when I create the file with New -> File and name it *.css the error did not occur.

Nabil A.
  • 3,270
  • 17
  • 29