Problems with Xtext in eclipse
Asked Answered
V

2

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.

Vaughn answered 21/9, 2012 at 10:7 Comment(4)
Please provide more information. Looks like you installed a plugin for editing CSS files that implemented in Xtext.Ocko
@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.Vaughn
@SebastianZarnekow I found it. It is the CssDsl editor. Do you have any idea how to disable it?Vaughn
@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.Lexical
N
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.
Naval answered 21/9, 2012 at 22:21 Comment(6)
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 PageVaughn
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.Hendeca
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?Wag
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.Hendeca
After removing the Xtext nature, you may also have to manually delete the problem markers in the Markers view. (This bug is supposed to be fixed, but it wasn't in the Eclipse version I'm using.)Pya
@Pya your solution solved my problem very well, thanks .Exiguous
C
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.

Chauchaucer answered 23/11, 2012 at 8:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.