Skip to content

Commit

Permalink
Merge pull request #3 from mrmlnc/fix-vscode-#4120
Browse files Browse the repository at this point in the history
Support !important in Variables (fix vscode#14120)
  • Loading branch information
aeschli authored Nov 23, 2016
2 parents 36b6be5 + 057b224 commit bfb6ac4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/parser/lessParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ export class LESSParser extends cssParser.Parser {
} else if (!node.setValue(this._parseExpr())) {
return <nodes.VariableDeclaration>this.finish(node, ParseError.VariableValueExpected, [], panic);
}

node.addChild(this._parsePrio());
} else {
this.restoreAtMark(mark);
return null; // at keyword, but no ':', not a variable declaration but some at keyword
Expand Down
4 changes: 2 additions & 2 deletions src/test/less/parser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ suite('LESS - Parser', () => {
assertNode('@primary-font: "wf_SegoeUI","Segoe UI","Segoe","Segoe WP"', parser, parser._parseVariableDeclaration.bind(parser));
assertNode('@greeting: `"hello".toUpperCase() + "!";`', parser, parser._parseVariableDeclaration.bind(parser));
assertNode('@greeting: { display: none; }', parser, parser._parseVariableDeclaration.bind(parser));

});
assertNode('@b: @a !important', parser, parser._parseVariableDeclaration.bind(parser));
});

test('MixinDeclaration', function() {
let parser = new LESSParser();
Expand Down

0 comments on commit bfb6ac4

Please sign in to comment.