vscode-css-languageservice
Advanced tools
Comparing version 2.0.0-next.7 to 2.0.0-next.8
@@ -91,2 +91,3 @@ var __extends = (this && this.__extends) || function (d, b) { | ||
NodeType[NodeType["CustomPropertySet"] = 64] = "CustomPropertySet"; | ||
NodeType[NodeType["ListEntry"] = 65] = "ListEntry"; | ||
})(NodeType = exports.NodeType || (exports.NodeType = {})); | ||
@@ -801,4 +802,7 @@ var ReferenceType; | ||
}); | ||
EachStatement.prototype.setVariable = function (node) { | ||
return this.setNode('variable', node, 0); | ||
EachStatement.prototype.getVariables = function () { | ||
if (!this.variables) { | ||
this.variables = new Nodelist(this); | ||
} | ||
return this.variables; | ||
}; | ||
@@ -805,0 +809,0 @@ return EachStatement; |
@@ -147,9 +147,19 @@ var __extends = (this && this.__extends) || function (d, b) { | ||
case nodes.NodeType.For: | ||
case nodes.NodeType.Each: { | ||
var forOrEachNode = node; | ||
var scopeNode = forOrEachNode.getDeclarations(); | ||
var forNode = node; | ||
var scopeNode = forNode.getDeclarations(); | ||
if (scopeNode) { | ||
this.addSymbolToChildScope(scopeNode, forOrEachNode.variable, forOrEachNode.variable.getName(), null, nodes.ReferenceType.Variable); | ||
this.addSymbolToChildScope(scopeNode, forNode.variable, forNode.variable.getName(), null, nodes.ReferenceType.Variable); | ||
} | ||
return true; | ||
case nodes.NodeType.Each: { | ||
var eachNode = node; | ||
var scopeNode_1 = eachNode.getDeclarations(); | ||
if (scopeNode_1) { | ||
var variables = eachNode.getVariables().getChildren(); | ||
for (var _i = 0, variables_1 = variables; _i < variables_1.length; _i++) { | ||
var variable = variables_1[_i]; | ||
this.addSymbolToChildScope(scopeNode_1, variable, variable.getName(), null, nodes.ReferenceType.Variable); | ||
} | ||
} | ||
return true; | ||
} | ||
@@ -156,0 +166,0 @@ } |
@@ -316,5 +316,12 @@ var __extends = (this && this.__extends) || function (d, b) { | ||
this.consumeToken(); // @each | ||
if (!node.setVariable(this._parseVariable())) { | ||
var variables = node.getVariables(); | ||
if (!variables.addChild(this._parseVariable())) { | ||
return this.finish(node, cssErrors_1.ParseError.VariableNameExpected, [cssScanner_1.TokenType.CurlyR]); | ||
} | ||
while (this.accept(cssScanner_1.TokenType.Comma)) { | ||
if (!variables.addChild(this._parseVariable())) { | ||
return this.finish(node, cssErrors_1.ParseError.VariableNameExpected, [cssScanner_1.TokenType.CurlyR]); | ||
} | ||
} | ||
this.finish(variables); | ||
if (!this.accept(cssScanner_1.TokenType.Ident, 'in')) { | ||
@@ -479,2 +486,27 @@ return this.finish(node, scssErrors_1.SCSSParseError.InExpected, [cssScanner_1.TokenType.CurlyR]); | ||
}; | ||
SCSSParser.prototype._parseOperation = function () { | ||
var node = this.create(nodes.Node); | ||
if (!this.accept(cssScanner_1.TokenType.ParenthesisL)) { | ||
return null; | ||
} | ||
while (node.addChild(this._parseListElement())) { | ||
this.accept(cssScanner_1.TokenType.Comma); // optional | ||
} | ||
if (!this.accept(cssScanner_1.TokenType.ParenthesisR)) { | ||
return this.finish(node, cssErrors_1.ParseError.RightParenthesisExpected); | ||
} | ||
return this.finish(node); | ||
}; | ||
SCSSParser.prototype._parseListElement = function () { | ||
var node = this.createNode(nodes.NodeType.ListEntry); | ||
if (!node.addChild(this._parseBinaryExpr())) { | ||
return null; | ||
} | ||
if (this.accept(cssScanner_1.TokenType.Colon)) { | ||
if (!node.addChild(this._parseBinaryExpr())) { | ||
return this.finish(node, cssErrors_1.ParseError.ExpressionExpected); | ||
} | ||
} | ||
return this.finish(node); | ||
}; | ||
return SCSSParser; | ||
@@ -481,0 +513,0 @@ }(cssParser.Parser)); |
{ | ||
"name": "vscode-css-languageservice", | ||
"version": "2.0.0-next.7", | ||
"version": "2.0.0-next.8", | ||
"description": "Language service for CSS, LESS and SCSS", | ||
@@ -5,0 +5,0 @@ "main": "./lib/cssLanguageService.js", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
740684
19662