vtst / ow

Various Eclipse plugins for web development
http://www.normalesup.org/~simonet/soft/
74 stars 29 forks source link

Less: "@import (less) "file.css"" breaks variable recognition #164

Closed heldchen closed 11 years ago

heldchen commented 11 years ago

since less 1.4.0 (https://github.com/less/less.js/blob/master/CHANGELOG.md#140-beta-1--2) it is now possible to specify how a file included with @import should be handled:

You can specify options on imports to force it to behave as css or less @import (less) "file.css" will process the file as less"

the following code unfortunately breaks:

@import (less) "base.css";

@size: 13px;

.control
{
    font-size: @size;
}

albeit the variable is declared locally, the syntax highlighter marks the line font-size: @size with the error The variable '@size' is undefined in this context. commenting out the import statement makes the error go away.

vtst commented 11 years ago

Thanks for the bug report. The problem came from the fact that .css files are not loaded by the plugin as LESS stylesheet. The code was throwing an IllegalStateException when attempting to access the contents of the CSS file. If fixed the code to catch the exception. Please note however that the contents of the css file will *not be analyzed by the plugin, though it is imported as a LESS stylesheet.

heldchen commented 11 years ago

perfect, thanks!