New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vscode-css-languageservice

Package Overview
Dependencies
Maintainers
4
Versions
187
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vscode-css-languageservice - npm Package Compare versions

Comparing version 2.1.4 to 2.1.5

5

lib/parser/cssErrors.js

@@ -18,3 +18,3 @@ (function (factory) {

var localize = nls.loadMessageBundle();
var CSSIssueType = (function () {
var CSSIssueType = /** @class */ (function () {
function CSSIssueType(id, message) {

@@ -55,5 +55,6 @@ this.id = id;

SelectorExpected: new CSSIssueType('css-selectorexpected', localize('expected.selector', "selector expected")),
StringLiteralExpected: new CSSIssueType('css-stringliteralexpected', localize('expected.stringliteral', "string literal expected"))
StringLiteralExpected: new CSSIssueType('css-stringliteralexpected', localize('expected.stringliteral', "string literal expected")),
WhitespaceExpected: new CSSIssueType('css-whitespaceexpected', localize('expected.whitespace', "whitespace expected"))
};
});
//# sourceMappingURL=cssErrors.js.map

153

lib/parser/cssNodes.js

@@ -99,2 +99,4 @@ var __extends = (this && this.__extends) || (function () {

NodeType[NodeType["ListEntry"] = 66] = "ListEntry";
NodeType[NodeType["Supports"] = 67] = "Supports";
NodeType[NodeType["SupportsCondition"] = 68] = "SupportsCondition";
})(NodeType = exports.NodeType || (exports.NodeType = {}));

@@ -151,3 +153,3 @@ var ReferenceType;

exports.getParentDeclaration = getParentDeclaration;
var Node = (function () {
var Node = /** @class */ (function () {
function Node(offset, len, nodeType) {

@@ -360,3 +362,3 @@ if (offset === void 0) { offset = -1; }

exports.Node = Node;
var Nodelist = (function (_super) {
var Nodelist = /** @class */ (function (_super) {
__extends(Nodelist, _super);

@@ -374,3 +376,3 @@ function Nodelist(parent, index) {

exports.Nodelist = Nodelist;
var Identifier = (function (_super) {
var Identifier = /** @class */ (function (_super) {
__extends(Identifier, _super);

@@ -395,3 +397,3 @@ function Identifier(offset, length) {

exports.Identifier = Identifier;
var Stylesheet = (function (_super) {
var Stylesheet = /** @class */ (function (_super) {
__extends(Stylesheet, _super);

@@ -414,3 +416,3 @@ function Stylesheet(offset, length) {

exports.Stylesheet = Stylesheet;
var Declarations = (function (_super) {
var Declarations = /** @class */ (function (_super) {
__extends(Declarations, _super);

@@ -430,3 +432,3 @@ function Declarations(offset, length) {

exports.Declarations = Declarations;
var BodyDeclaration = (function (_super) {
var BodyDeclaration = /** @class */ (function (_super) {
__extends(BodyDeclaration, _super);

@@ -445,3 +447,3 @@ function BodyDeclaration(offset, length) {

exports.BodyDeclaration = BodyDeclaration;
var RuleSet = (function (_super) {
var RuleSet = /** @class */ (function (_super) {
__extends(RuleSet, _super);

@@ -470,3 +472,3 @@ function RuleSet(offset, length) {

exports.RuleSet = RuleSet;
var Selector = (function (_super) {
var Selector = /** @class */ (function (_super) {
__extends(Selector, _super);

@@ -486,3 +488,3 @@ function Selector(offset, length) {

exports.Selector = Selector;
var SimpleSelector = (function (_super) {
var SimpleSelector = /** @class */ (function (_super) {
__extends(SimpleSelector, _super);

@@ -502,3 +504,3 @@ function SimpleSelector(offset, length) {

exports.SimpleSelector = SimpleSelector;
var AtApplyRule = (function (_super) {
var AtApplyRule = /** @class */ (function (_super) {
__extends(AtApplyRule, _super);

@@ -527,3 +529,3 @@ function AtApplyRule(offset, length) {

exports.AtApplyRule = AtApplyRule;
var AbstractDeclaration = (function (_super) {
var AbstractDeclaration = /** @class */ (function (_super) {
__extends(AbstractDeclaration, _super);

@@ -536,3 +538,3 @@ function AbstractDeclaration(offset, length) {

exports.AbstractDeclaration = AbstractDeclaration;
var CustomPropertyDeclaration = (function (_super) {
var CustomPropertyDeclaration = /** @class */ (function (_super) {
__extends(CustomPropertyDeclaration, _super);

@@ -570,3 +572,3 @@ function CustomPropertyDeclaration(offset, length) {

exports.CustomPropertyDeclaration = CustomPropertyDeclaration;
var CustomPropertySet = (function (_super) {
var CustomPropertySet = /** @class */ (function (_super) {
__extends(CustomPropertySet, _super);

@@ -586,3 +588,3 @@ function CustomPropertySet(offset, length) {

exports.CustomPropertySet = CustomPropertySet;
var Declaration = (function (_super) {
var Declaration = /** @class */ (function (_super) {
__extends(Declaration, _super);

@@ -640,3 +642,3 @@ function Declaration(offset, length) {

exports.Declaration = Declaration;
var Property = (function (_super) {
var Property = /** @class */ (function (_super) {
__extends(Property, _super);

@@ -668,3 +670,3 @@ function Property(offset, length) {

exports.Property = Property;
var Invocation = (function (_super) {
var Invocation = /** @class */ (function (_super) {
__extends(Invocation, _super);

@@ -690,3 +692,3 @@ function Invocation(offset, length) {

exports.Invocation = Invocation;
var Function = (function (_super) {
var Function = /** @class */ (function (_super) {
__extends(Function, _super);

@@ -715,3 +717,3 @@ function Function(offset, length) {

exports.Function = Function;
var FunctionParameter = (function (_super) {
var FunctionParameter = /** @class */ (function (_super) {
__extends(FunctionParameter, _super);

@@ -746,3 +748,3 @@ function FunctionParameter(offset, length) {

exports.FunctionParameter = FunctionParameter;
var FunctionArgument = (function (_super) {
var FunctionArgument = /** @class */ (function (_super) {
__extends(FunctionArgument, _super);

@@ -777,3 +779,3 @@ function FunctionArgument(offset, length) {

exports.FunctionArgument = FunctionArgument;
var IfStatement = (function (_super) {
var IfStatement = /** @class */ (function (_super) {
__extends(IfStatement, _super);

@@ -799,3 +801,3 @@ function IfStatement(offset, length) {

exports.IfStatement = IfStatement;
var ForStatement = (function (_super) {
var ForStatement = /** @class */ (function (_super) {
__extends(ForStatement, _super);

@@ -818,3 +820,3 @@ function ForStatement(offset, length) {

exports.ForStatement = ForStatement;
var EachStatement = (function (_super) {
var EachStatement = /** @class */ (function (_super) {
__extends(EachStatement, _super);

@@ -840,3 +842,3 @@ function EachStatement(offset, length) {

exports.EachStatement = EachStatement;
var WhileStatement = (function (_super) {
var WhileStatement = /** @class */ (function (_super) {
__extends(WhileStatement, _super);

@@ -856,3 +858,3 @@ function WhileStatement(offset, length) {

exports.WhileStatement = WhileStatement;
var ElseStatement = (function (_super) {
var ElseStatement = /** @class */ (function (_super) {
__extends(ElseStatement, _super);

@@ -872,3 +874,3 @@ function ElseStatement(offset, length) {

exports.ElseStatement = ElseStatement;
var FunctionDeclaration = (function (_super) {
var FunctionDeclaration = /** @class */ (function (_super) {
__extends(FunctionDeclaration, _super);

@@ -903,3 +905,3 @@ function FunctionDeclaration(offset, length) {

exports.FunctionDeclaration = FunctionDeclaration;
var ViewPort = (function (_super) {
var ViewPort = /** @class */ (function (_super) {
__extends(ViewPort, _super);

@@ -919,3 +921,3 @@ function ViewPort(offset, length) {

exports.ViewPort = ViewPort;
var FontFace = (function (_super) {
var FontFace = /** @class */ (function (_super) {
__extends(FontFace, _super);

@@ -935,3 +937,3 @@ function FontFace(offset, length) {

exports.FontFace = FontFace;
var NestedProperties = (function (_super) {
var NestedProperties = /** @class */ (function (_super) {
__extends(NestedProperties, _super);

@@ -951,3 +953,3 @@ function NestedProperties(offset, length) {

exports.NestedProperties = NestedProperties;
var Keyframe = (function (_super) {
var Keyframe = /** @class */ (function (_super) {
__extends(Keyframe, _super);

@@ -982,3 +984,3 @@ function Keyframe(offset, length) {

exports.Keyframe = Keyframe;
var KeyframeSelector = (function (_super) {
var KeyframeSelector = /** @class */ (function (_super) {
__extends(KeyframeSelector, _super);

@@ -998,3 +1000,3 @@ function KeyframeSelector(offset, length) {

exports.KeyframeSelector = KeyframeSelector;
var Import = (function (_super) {
var Import = /** @class */ (function (_super) {
__extends(Import, _super);

@@ -1022,3 +1024,3 @@ function Import(offset, length) {

exports.Import = Import;
var Namespace = (function (_super) {
var Namespace = /** @class */ (function (_super) {
__extends(Namespace, _super);

@@ -1038,3 +1040,3 @@ function Namespace(offset, length) {

exports.Namespace = Namespace;
var Media = (function (_super) {
var Media = /** @class */ (function (_super) {
__extends(Media, _super);

@@ -1054,3 +1056,18 @@ function Media(offset, length) {

exports.Media = Media;
var Document = (function (_super) {
var Supports = /** @class */ (function (_super) {
__extends(Supports, _super);
function Supports(offset, length) {
return _super.call(this, offset, length) || this;
}
Object.defineProperty(Supports.prototype, "type", {
get: function () {
return NodeType.Supports;
},
enumerable: true,
configurable: true
});
return Supports;
}(BodyDeclaration));
exports.Supports = Supports;
var Document = /** @class */ (function (_super) {
__extends(Document, _super);

@@ -1070,3 +1087,3 @@ function Document(offset, length) {

exports.Document = Document;
var Medialist = (function (_super) {
var Medialist = /** @class */ (function (_super) {
__extends(Medialist, _super);

@@ -1085,3 +1102,3 @@ function Medialist(offset, length) {

exports.Medialist = Medialist;
var MediaQuery = (function (_super) {
var MediaQuery = /** @class */ (function (_super) {
__extends(MediaQuery, _super);

@@ -1101,3 +1118,18 @@ function MediaQuery(offset, length) {

exports.MediaQuery = MediaQuery;
var Page = (function (_super) {
var SupportsCondition = /** @class */ (function (_super) {
__extends(SupportsCondition, _super);
function SupportsCondition(offset, length) {
return _super.call(this, offset, length) || this;
}
Object.defineProperty(SupportsCondition.prototype, "type", {
get: function () {
return NodeType.SupportsCondition;
},
enumerable: true,
configurable: true
});
return SupportsCondition;
}(Node));
exports.SupportsCondition = SupportsCondition;
var Page = /** @class */ (function (_super) {
__extends(Page, _super);

@@ -1117,3 +1149,3 @@ function Page(offset, length) {

exports.Page = Page;
var PageBoxMarginBox = (function (_super) {
var PageBoxMarginBox = /** @class */ (function (_super) {
__extends(PageBoxMarginBox, _super);

@@ -1133,3 +1165,3 @@ function PageBoxMarginBox(offset, length) {

exports.PageBoxMarginBox = PageBoxMarginBox;
var Expression = (function (_super) {
var Expression = /** @class */ (function (_super) {
__extends(Expression, _super);

@@ -1149,3 +1181,3 @@ function Expression(offset, length) {

exports.Expression = Expression;
var BinaryExpression = (function (_super) {
var BinaryExpression = /** @class */ (function (_super) {
__extends(BinaryExpression, _super);

@@ -1183,3 +1215,3 @@ function BinaryExpression(offset, length) {

exports.BinaryExpression = BinaryExpression;
var Term = (function (_super) {
var Term = /** @class */ (function (_super) {
__extends(Term, _super);

@@ -1211,3 +1243,3 @@ function Term(offset, length) {

exports.Term = Term;
var Operator = (function (_super) {
var Operator = /** @class */ (function (_super) {
__extends(Operator, _super);

@@ -1227,3 +1259,3 @@ function Operator(offset, length) {

exports.Operator = Operator;
var HexColorValue = (function (_super) {
var HexColorValue = /** @class */ (function (_super) {
__extends(HexColorValue, _super);

@@ -1243,3 +1275,3 @@ function HexColorValue(offset, length) {

exports.HexColorValue = HexColorValue;
var NumericValue = (function (_super) {
var NumericValue = /** @class */ (function (_super) {
__extends(NumericValue, _super);

@@ -1274,3 +1306,3 @@ function NumericValue(offset, length) {

exports.NumericValue = NumericValue;
var VariableDeclaration = (function (_super) {
var VariableDeclaration = /** @class */ (function (_super) {
__extends(VariableDeclaration, _super);

@@ -1315,3 +1347,3 @@ function VariableDeclaration(offset, length) {

exports.VariableDeclaration = VariableDeclaration;
var Interpolation = (function (_super) {
var Interpolation = /** @class */ (function (_super) {
__extends(Interpolation, _super);

@@ -1331,3 +1363,3 @@ function Interpolation(offset, length) {

exports.Interpolation = Interpolation;
var Variable = (function (_super) {
var Variable = /** @class */ (function (_super) {
__extends(Variable, _super);

@@ -1350,3 +1382,3 @@ function Variable(offset, length) {

exports.Variable = Variable;
var ExtendsReference = (function (_super) {
var ExtendsReference = /** @class */ (function (_super) {
__extends(ExtendsReference, _super);

@@ -1363,15 +1395,12 @@ function ExtendsReference(offset, length) {

});
ExtendsReference.prototype.setSelector = function (node) {
return this.setNode('selector', node, 0);
ExtendsReference.prototype.getSelectors = function () {
if (!this.selectors) {
this.selectors = new Nodelist(this);
}
return this.selectors;
};
ExtendsReference.prototype.getSelector = function () {
return this.selector;
};
ExtendsReference.prototype.getName = function () {
return this.selector ? this.selector.getText() : '';
};
return ExtendsReference;
}(Node));
exports.ExtendsReference = ExtendsReference;
var MixinReference = (function (_super) {
var MixinReference = /** @class */ (function (_super) {
__extends(MixinReference, _super);

@@ -1418,3 +1447,3 @@ function MixinReference(offset, length) {

exports.MixinReference = MixinReference;
var MixinDeclaration = (function (_super) {
var MixinDeclaration = /** @class */ (function (_super) {
__extends(MixinDeclaration, _super);

@@ -1456,3 +1485,3 @@ function MixinDeclaration(offset, length) {

exports.MixinDeclaration = MixinDeclaration;
var LessGuard = (function (_super) {
var LessGuard = /** @class */ (function (_super) {
__extends(LessGuard, _super);

@@ -1471,3 +1500,3 @@ function LessGuard() {

exports.LessGuard = LessGuard;
var GuardCondition = (function (_super) {
var GuardCondition = /** @class */ (function (_super) {
__extends(GuardCondition, _super);

@@ -1489,3 +1518,3 @@ function GuardCondition() {

})(Level = exports.Level || (exports.Level = {}));
var Marker = (function () {
var Marker = /** @class */ (function () {
function Marker(node, rule, level, message, offset, length) {

@@ -1682,3 +1711,3 @@ if (offset === void 0) { offset = node.offset; }

*/
var ParseErrorCollector = (function () {
var ParseErrorCollector = /** @class */ (function () {
function ParseErrorCollector() {

@@ -1685,0 +1714,0 @@ this.entries = [];

@@ -24,3 +24,3 @@ (function (factory) {

/// </summary>
var Parser = (function () {
var Parser = /** @class */ (function () {
function Parser(scnr) {

@@ -72,2 +72,10 @@ if (scnr === void 0) { scnr = new cssScanner_1.Scanner(); }

};
Parser.prototype.try = function (func) {
var pos = this.mark();
if (!func()) {
this.restoreAtMark(pos);
return false;
}
return true;
};
Parser.prototype.acceptOne = function (type, text, ignoreCase) {

@@ -223,2 +231,3 @@ if (ignoreCase === void 0) { ignoreCase = true; }

|| this._parseKeyframe()
|| this._parseSupports()
|| this._parseViewPort()

@@ -473,3 +482,3 @@ || this._parseNamespace()

break;
case cssScanner_1.TokenType.BadString:
case cssScanner_1.TokenType.BadString:// fall through
break done;

@@ -611,2 +620,84 @@ case cssScanner_1.TokenType.EOF:

};
Parser.prototype._parseSupports = function (isNested) {
if (isNested === void 0) { isNested = false; }
// SUPPORTS_SYM S* supports_condition '{' S* ruleset* '}' S*
if (!this.peek(cssScanner_1.TokenType.AtKeyword, '@supports')) {
return null;
}
var node = this.create(nodes.Supports);
this.consumeToken(); // @supports
node.addChild(this._parseSupportsCondition());
return this._parseBody(node, this._parseSupportsDeclaration.bind(this, isNested));
};
Parser.prototype._parseSupportsDeclaration = function (isNested) {
if (isNested === void 0) { isNested = false; }
return this._parseStylesheetStatement();
};
Parser.prototype._parseSupportsCondition = function () {
// supports_condition : supports_negation | supports_conjunction | supports_disjunction | supports_condition_in_parens ;
// supports_condition_in_parens: ( '(' S* supports_condition S* ')' ) | supports_declaration_condition | general_enclosed ;
// supports_negation: NOT S+ supports_condition_in_parens ;
// supports_conjunction: supports_condition_in_parens ( S+ AND S+ supports_condition_in_parens )+;
// supports_disjunction: supports_condition_in_parens ( S+ OR S+ supports_condition_in_parens )+;
// supports_declaration_condition: '(' S* declaration ')';
// general_enclosed: ( FUNCTION | '(' ) ( any | unused )* ')' ;
var node = this.create(nodes.SupportsCondition);
if (this.accept(cssScanner_1.TokenType.Ident, 'not', true)) {
if (!this.hasWhitespace()) {
return this.finish(node, cssErrors_1.ParseError.WhitespaceExpected);
}
node.addChild(this._parseSupportsConditionInParens());
}
else {
node.addChild(this._parseSupportsConditionInParens());
if (this.peekRegExp(cssScanner_1.TokenType.Ident, /^(and|or)$/i)) {
var text = this.token.text;
if (!this.hasWhitespace()) {
return this.finish(node, cssErrors_1.ParseError.WhitespaceExpected);
}
while (this.accept(cssScanner_1.TokenType.Ident, text, true)) {
if (!this.hasWhitespace()) {
return this.finish(node, cssErrors_1.ParseError.WhitespaceExpected);
}
node.addChild(this._parseSupportsConditionInParens());
}
}
}
return this.finish(node);
};
Parser.prototype._parseSupportsConditionInParens = function () {
var node = this.create(nodes.SupportsCondition);
if (this.accept(cssScanner_1.TokenType.ParenthesisL)) {
if (!node.addChild(this._tryToParseDeclaration())) {
if (!this._parseSupportsCondition()) {
return this.finish(node, cssErrors_1.ParseError.ConditionExpected);
}
}
if (!this.accept(cssScanner_1.TokenType.ParenthesisR)) {
return this.finish(node, cssErrors_1.ParseError.RightParenthesisExpected, [cssScanner_1.TokenType.ParenthesisR], []);
}
return this.finish(node);
}
else if (this.peek(cssScanner_1.TokenType.Ident)) {
var pos = this.mark();
this.consumeToken();
if (!this.hasWhitespace() && this.accept(cssScanner_1.TokenType.ParenthesisL)) {
var openParentCount = 1;
while (this.token.type !== cssScanner_1.TokenType.EOF && openParentCount !== 0) {
if (this.token.type === cssScanner_1.TokenType.ParenthesisL) {
openParentCount++;
}
else if (this.token.type === cssScanner_1.TokenType.ParenthesisR) {
openParentCount--;
}
this.consumeToken();
}
return this.finish(node);
}
else {
this.restoreAtMark(pos);
}
}
return this.finish(node, cssErrors_1.ParseError.LeftParenthesisExpected, [], [cssScanner_1.TokenType.ParenthesisL]);
};
Parser.prototype._parseMediaDeclaration = function (isNested) {

@@ -963,4 +1054,4 @@ if (isNested === void 0) { isNested = false; }

node.setOperator(this._parseUnaryOperator()); // optional
if (node.setExpression(this._parseURILiteral()) ||
node.setExpression(this._parseFunction()) ||
if (node.setExpression(this._parseURILiteral()) || // url before function
node.setExpression(this._parseFunction()) || // function before ident
node.setExpression(this._parseIdent()) ||

@@ -967,0 +1058,0 @@ node.setExpression(this._parseStringLiteral()) ||

@@ -62,3 +62,3 @@ (function (factory) {

})(TokenType = exports.TokenType || (exports.TokenType = {}));
var MultiLineStream = (function () {
var MultiLineStream = /** @class */ (function () {
function MultiLineStream(source) {

@@ -200,3 +200,3 @@ this.source = source;

staticUnitTable['dpcm'] = TokenType.Resolution;
var Scanner = (function () {
var Scanner = /** @class */ (function () {
function Scanner() {

@@ -557,5 +557,5 @@ this.ignoreComment = true;

var ch = this.stream.peekChar();
if (ch === _USC ||
ch >= _a && ch <= _z ||
ch >= _A && ch <= _Z ||
if (ch === _USC || // _
ch >= _a && ch <= _z || // a-z
ch >= _A && ch <= _Z || // A-Z
ch >= 0x80 && ch <= 0xFFFF) {

@@ -579,7 +579,7 @@ this.stream.advance(1);

var ch = this.stream.peekChar();
if (ch === _USC ||
ch === _MIN ||
ch >= _a && ch <= _z ||
ch >= _A && ch <= _Z ||
ch >= _0 && ch <= _9 ||
if (ch === _USC || // _
ch === _MIN || // -
ch >= _a && ch <= _z || // a-z
ch >= _A && ch <= _Z || // A-Z
ch >= _0 && ch <= _9 || // 0/9
ch >= 0x80 && ch <= 0xFFFF) {

@@ -586,0 +586,0 @@ this.stream.advance(1);

@@ -28,3 +28,3 @@ var __extends = (this && this.__extends) || (function () {

var arrays_1 = require("../utils/arrays");
var Scope = (function () {
var Scope = /** @class */ (function () {
function Scope(offset, length) {

@@ -84,3 +84,3 @@ this.offset = offset;

exports.Scope = Scope;
var GlobalScope = (function (_super) {
var GlobalScope = /** @class */ (function (_super) {
__extends(GlobalScope, _super);

@@ -93,3 +93,3 @@ function GlobalScope() {

exports.GlobalScope = GlobalScope;
var Symbol = (function () {
var Symbol = /** @class */ (function () {
function Symbol(name, value, node, type) {

@@ -104,3 +104,3 @@ this.name = name;

exports.Symbol = Symbol;
var ScopeBuilder = (function () {
var ScopeBuilder = /** @class */ (function () {
function ScopeBuilder(scope) {

@@ -225,3 +225,3 @@ this.scope = scope;

exports.ScopeBuilder = ScopeBuilder;
var Symbols = (function () {
var Symbols = /** @class */ (function () {
function Symbols(node) {

@@ -228,0 +228,0 @@ this.global = new GlobalScope();

@@ -35,3 +35,3 @@ var __extends = (this && this.__extends) || (function () {

/// </summary>
var LESSParser = (function (_super) {
var LESSParser = /** @class */ (function (_super) {
__extends(LESSParser, _super);

@@ -326,5 +326,11 @@ function LESSParser() {

}
if (!node.setSelector(this._parseSelector(true))) {
var selectors = node.getSelectors();
if (!selectors.addChild(this._parseSelector(true))) {
return this.finish(node, cssErrors_1.ParseError.SelectorExpected);
}
while (this.accept(cssScanner_1.TokenType.Comma)) {
if (!selectors.addChild(this._parseSelector(true))) {
return this.finish(node, cssErrors_1.ParseError.SelectorExpected);
}
}
if (!this.accept(cssScanner_1.TokenType.ParenthesisR)) {

@@ -331,0 +337,0 @@ return this.finish(node, cssErrors_1.ParseError.RightParenthesisExpected);

@@ -35,3 +35,3 @@ var __extends = (this && this.__extends) || (function () {

exports.Ellipsis = customTokenValue++;
var LESSScanner = (function (_super) {
var LESSScanner = /** @class */ (function (_super) {
__extends(LESSScanner, _super);

@@ -38,0 +38,0 @@ function LESSScanner() {

@@ -18,3 +18,3 @@ (function (factory) {

var localize = nls.loadMessageBundle();
var SCSSIssueType = (function () {
var SCSSIssueType = /** @class */ (function () {
function SCSSIssueType(id, message) {

@@ -21,0 +21,0 @@ this.id = id;

@@ -36,3 +36,3 @@ var __extends = (this && this.__extends) || (function () {

/// </summary>
var SCSSParser = (function (_super) {
var SCSSParser = /** @class */ (function (_super) {
__extends(SCSSParser, _super);

@@ -106,6 +106,16 @@ function SCSSParser() {

SCSSParser.prototype._parseIdent = function (referenceTypes) {
var _this = this;
var node = this.create(nodes.Identifier);
node.referenceTypes = referenceTypes;
var hasContent = false;
while (this.accept(cssScanner_1.TokenType.Ident) || node.addChild(this._parseInterpolation())) {
var delimWithInterpolation = function () {
if (!_this.accept(cssScanner_1.TokenType.Delim, '-')) {
return false;
}
if (!_this.hasWhitespace() && _this.accept(cssScanner_1.TokenType.Delim, '-')) {
node.isCustomProperty = true;
}
return !_this.hasWhitespace() && node.addChild(_this._parseInterpolation());
};
while (this.accept(cssScanner_1.TokenType.Ident) || node.addChild(this._parseInterpolation()) || this.try(delimWithInterpolation)) {
hasContent = true;

@@ -219,3 +229,3 @@ if (!this.hasWhitespace() && this.accept(cssScanner_1.TokenType.Delim, '-')) {

if (this.accept(cssScanner_1.TokenType.AtKeyword, '@extend')) {
if (!node.setSelector(this._parseSimpleSelector())) {
if (!node.getSelectors().addChild(this._parseSimpleSelector())) {
return this.finish(node, cssErrors_1.ParseError.SelectorExpected);

@@ -222,0 +232,0 @@ }

@@ -48,3 +48,3 @@ var __extends = (this && this.__extends) || (function () {

exports.Ellipsis = customTokenValue++;
var SCSSScanner = (function (_super) {
var SCSSScanner = /** @class */ (function (_super) {
__extends(SCSSScanner, _super);

@@ -51,0 +51,0 @@ function SCSSScanner() {

@@ -23,3 +23,3 @@ (function (factory) {

var localize = nls.loadMessageBundle();
var CSSCodeActions = (function () {
var CSSCodeActions = /** @class */ (function () {
function CSSCodeActions() {

@@ -26,0 +26,0 @@ }

@@ -24,3 +24,3 @@ (function (factory) {

var SnippetFormat = vscode_languageserver_types_1.InsertTextFormat.Snippet;
var CSSCompletion = (function () {
var CSSCompletion = /** @class */ (function () {
function CSSCompletion(variablePrefix) {

@@ -720,3 +720,3 @@ if (variablePrefix === void 0) { variablePrefix = null; }

exports.CSSCompletion = CSSCompletion;
var Set = (function () {
var Set = /** @class */ (function () {
function Set() {

@@ -733,3 +733,3 @@ this.entries = {};

}());
var InternalValueCollector = (function () {
var InternalValueCollector = /** @class */ (function () {
function InternalValueCollector(entries) {

@@ -747,3 +747,3 @@ this.entries = entries;

}());
var ValuesCollector = (function () {
var ValuesCollector = /** @class */ (function () {
function ValuesCollector(propertyName, entries) {

@@ -771,3 +771,3 @@ this.propertyName = propertyName;

}());
var ColorValueCollector = (function () {
var ColorValueCollector = /** @class */ (function () {
function ColorValueCollector(entries) {

@@ -774,0 +774,0 @@ this.entries = entries;

@@ -20,3 +20,3 @@ (function (factory) {

var selectorPrinting_1 = require("./selectorPrinting");
var CSSHover = (function () {
var CSSHover = /** @class */ (function () {
function CSSHover() {

@@ -23,0 +23,0 @@ }

@@ -22,3 +22,3 @@ (function (factory) {

var localize = nls.loadMessageBundle();
var CSSNavigation = (function () {
var CSSNavigation = /** @class */ (function () {
function CSSNavigation() {

@@ -25,0 +25,0 @@ }

@@ -20,3 +20,3 @@ (function (factory) {

var lint_1 = require("./lint");
var CSSValidation = (function () {
var CSSValidation = /** @class */ (function () {
function CSSValidation() {

@@ -23,0 +23,0 @@ }

@@ -598,3 +598,3 @@ (function (factory) {

}
var ValueImpl = (function () {
var ValueImpl = /** @class */ (function () {
function ValueImpl(data) {

@@ -629,3 +629,3 @@ this.data = data;

}());
var EntryImpl = (function () {
var EntryImpl = /** @class */ (function () {
function EntryImpl(data) {

@@ -632,0 +632,0 @@ this.data = data;

@@ -30,3 +30,3 @@ var __extends = (this && this.__extends) || (function () {

var localize = nls.loadMessageBundle();
var LESSCompletion = (function (_super) {
var LESSCompletion = /** @class */ (function (_super) {
__extends(LESSCompletion, _super);

@@ -66,314 +66,314 @@ function LESSCompletion() {

};
LESSCompletion.builtInProposals = [
{
'name': 'escape',
'example': 'escape(@string);',
'description': localize('less.builtin.escape', 'URL encodes a string')
},
{
'name': 'e',
'example': 'e(@string);',
'description': localize('less.builtin.e', 'escape string content')
},
{
'name': 'replace',
'example': 'replace(@string, @pattern, @replacement[, @flags]);',
'description': localize('less.builtin.replace', 'string replace')
},
{
'name': 'unit',
'example': 'unit(@dimension, [@unit: \'\']);',
'description': localize('less.builtin.unit', 'remove or change the unit of a dimension')
},
{
'name': 'color',
'example': 'color(@string);',
'description': localize('less.builtin.color', 'parses a string to a color'),
'type': 'color'
},
{
'name': 'convert',
'example': 'convert(@value, unit);',
'description': localize('less.builtin.convert', 'converts numbers from one type into another')
},
{
'name': 'data-uri',
'example': 'data-uri([mimetype,] url);',
'description': localize('less.builtin.data-uri', 'inlines a resource and falls back to `url()`'),
'type': 'url'
},
{
'name': 'length',
'example': 'length(@list);',
'description': localize('less.builtin.length', 'returns the number of elements in a value list')
},
{
'name': 'extract',
'example': 'extract(@list, index);',
'description': localize('less.builtin.extract', 'returns a value at the specified position in the list')
},
{
'name': 'abs',
'description': localize('less.builtin.abs', 'absolute value of a number'),
'example': 'abs(number);'
},
{
'name': 'acos',
'description': localize('less.builtin.acos', 'arccosine - inverse of cosine function'),
'example': 'acos(number);'
},
{
'name': 'asin',
'description': localize('less.builtin.asin', 'arcsine - inverse of sine function'),
'example': 'asin(number);'
},
{
'name': 'ceil',
'example': 'ceil(@number);',
'description': localize('less.builtin.ceil', 'rounds up to an integer')
},
{
'name': 'cos',
'description': localize('less.builtin.cos', 'cosine function'),
'example': 'cos(number);'
},
{
'name': 'floor',
'description': localize('less.builtin.floor', 'rounds down to an integer'),
'example': 'floor(@number);'
},
{
'name': 'percentage',
'description': localize('less.builtin.percentage', 'converts to a %, e.g. 0.5 > 50%'),
'example': 'percentage(@number);',
'type': 'percentage'
},
{
'name': 'round',
'description': localize('less.builtin.round', 'rounds a number to a number of places'),
'example': 'round(number, [places: 0]);'
},
{
'name': 'sqrt',
'description': localize('less.builtin.sqrt', 'calculates square root of a number'),
'example': 'sqrt(number);'
},
{
'name': 'sin',
'description': localize('less.builtin.sin', 'sine function'),
'example': 'sin(number);'
},
{
'name': 'tan',
'description': localize('less.builtin.tan', 'tangent function'),
'example': 'tan(number);'
},
{
'name': 'atan',
'description': localize('less.builtin.atan', 'arctangent - inverse of tangent function'),
'example': 'atan(number);'
},
{
'name': 'pi',
'description': localize('less.builtin.pi', 'returns pi'),
'example': 'pi();'
},
{
'name': 'pow',
'description': localize('less.builtin.pow', 'first argument raised to the power of the second argument'),
'example': 'pow(@base, @exponent);'
},
{
'name': 'mod',
'description': localize('less.builtin.mod', 'first argument modulus second argument'),
'example': 'mod(number, number);'
},
{
'name': 'min',
'description': localize('less.builtin.min', 'returns the lowest of one or more values'),
'example': 'min(@x, @y);'
},
{
'name': 'max',
'description': localize('less.builtin.max', 'returns the lowest of one or more values'),
'example': 'max(@x, @y);'
}
];
LESSCompletion.colorProposals = [
{
'name': 'argb',
'example': 'argb(@color);',
'description': localize('less.builtin.argb', 'creates a #AARRGGBB')
},
{
'name': 'hsl',
'example': 'hsl(@hue, @saturation, @lightness);',
'description': localize('less.builtin.hsl', 'creates a color')
},
{
'name': 'hsla',
'example': 'hsla(@hue, @saturation, @lightness, @alpha);',
'description': localize('less.builtin.hsla', 'creates a color')
},
{
'name': 'hsv',
'example': 'hsv(@hue, @saturation, @value);',
'description': localize('less.builtin.hsv', 'creates a color')
},
{
'name': 'hsva',
'example': 'hsva(@hue, @saturation, @value, @alpha);',
'description': localize('less.builtin.hsva', 'creates a color')
},
{
'name': 'hue',
'example': 'hue(@color);',
'description': localize('less.builtin.hue', 'returns the `hue` channel of `@color` in the HSL space')
},
{
'name': 'saturation',
'example': 'saturation(@color);',
'description': localize('less.builtin.saturation', 'returns the `saturation` channel of `@color` in the HSL space')
},
{
'name': 'lightness',
'example': 'lightness(@color);',
'description': localize('less.builtin.lightness', 'returns the `lightness` channel of `@color` in the HSL space')
},
{
'name': 'hsvhue',
'example': 'hsvhue(@color);',
'description': localize('less.builtin.hsvhue', 'returns the `hue` channel of `@color` in the HSV space')
},
{
'name': 'hsvsaturation',
'example': 'hsvsaturation(@color);',
'description': localize('less.builtin.hsvsaturation', 'returns the `saturation` channel of `@color` in the HSV space')
},
{
'name': 'hsvvalue',
'example': 'hsvvalue(@color);',
'description': localize('less.builtin.hsvvalue', 'returns the `value` channel of `@color` in the HSV space')
},
{
'name': 'red',
'example': 'red(@color);',
'description': localize('less.builtin.red', 'returns the `red` channel of `@color`')
},
{
'name': 'green',
'example': 'green(@color);',
'description': localize('less.builtin.green', 'returns the `green` channel of `@color`')
},
{
'name': 'blue',
'example': 'blue(@color);',
'description': localize('less.builtin.blue', 'returns the `blue` channel of `@color`')
},
{
'name': 'alpha',
'example': 'alpha(@color);',
'description': localize('less.builtin.alpha', 'returns the `alpha` channel of `@color`')
},
{
'name': 'luma',
'example': 'luma(@color);',
'description': localize('less.builtin.luma', 'returns the `luma` value (perceptual brightness) of `@color`')
},
{
'name': 'saturate',
'example': 'saturate(@color, 10%);',
'description': localize('less.builtin.saturate', 'return `@color` 10% points more saturated')
},
{
'name': 'desaturate',
'example': 'desaturate(@color, 10%);',
'description': localize('less.builtin.desaturate', 'return `@color` 10% points less saturated')
},
{
'name': 'lighten',
'example': 'lighten(@color, 10%);',
'description': localize('less.builtin.lighten', 'return `@color` 10% points lighter')
},
{
'name': 'darken',
'example': 'darken(@color, 10%);',
'description': localize('less.builtin.darken', 'return `@color` 10% points darker')
},
{
'name': 'fadein',
'example': 'fadein(@color, 10%);',
'description': localize('less.builtin.fadein', 'return `@color` 10% points less transparent')
},
{
'name': 'fadeout',
'example': 'fadeout(@color, 10%);',
'description': localize('less.builtin.fadeout', 'return `@color` 10% points more transparent')
},
{
'name': 'fade',
'example': 'fade(@color, 50%);',
'description': localize('less.builtin.fade', 'return `@color` with 50% transparency')
},
{
'name': 'spin',
'example': 'spin(@color, 10);',
'description': localize('less.builtin.spin', 'return `@color` with a 10 degree larger in hue')
},
{
'name': 'mix',
'example': 'mix(@color1, @color2, [@weight: 50%]);',
'description': localize('less.builtin.mix', 'return a mix of `@color1` and `@color2`')
},
{
'name': 'greyscale',
'example': 'greyscale(@color);',
'description': localize('less.builtin.greyscale', 'returns a grey, 100% desaturated color'),
},
{
'name': 'contrast',
'example': 'contrast(@color1, [@darkcolor: black], [@lightcolor: white], [@threshold: 43%]);',
'description': localize('less.builtin.contrast', 'return `@darkcolor` if `@color1 is> 43% luma` otherwise return `@lightcolor`, see notes')
},
{
'name': 'multiply',
'example': 'multiply(@color1, @color2);'
},
{
'name': 'screen',
'example': 'screen(@color1, @color2);'
},
{
'name': 'overlay',
'example': 'overlay(@color1, @color2);'
},
{
'name': 'softlight',
'example': 'softlight(@color1, @color2);'
},
{
'name': 'hardlight',
'example': 'hardlight(@color1, @color2);'
},
{
'name': 'difference',
'example': 'difference(@color1, @color2);'
},
{
'name': 'exclusion',
'example': 'exclusion(@color1, @color2);'
},
{
'name': 'average',
'example': 'average(@color1, @color2);'
},
{
'name': 'negation',
'example': 'negation(@color1, @color2);'
}
];
return LESSCompletion;
}(cssCompletion_1.CSSCompletion));
LESSCompletion.builtInProposals = [
{
'name': 'escape',
'example': 'escape(@string);',
'description': localize('less.builtin.escape', 'URL encodes a string')
},
{
'name': 'e',
'example': 'e(@string);',
'description': localize('less.builtin.e', 'escape string content')
},
{
'name': 'replace',
'example': 'replace(@string, @pattern, @replacement[, @flags]);',
'description': localize('less.builtin.replace', 'string replace')
},
{
'name': 'unit',
'example': 'unit(@dimension, [@unit: \'\']);',
'description': localize('less.builtin.unit', 'remove or change the unit of a dimension')
},
{
'name': 'color',
'example': 'color(@string);',
'description': localize('less.builtin.color', 'parses a string to a color'),
'type': 'color'
},
{
'name': 'convert',
'example': 'convert(@value, unit);',
'description': localize('less.builtin.convert', 'converts numbers from one type into another')
},
{
'name': 'data-uri',
'example': 'data-uri([mimetype,] url);',
'description': localize('less.builtin.data-uri', 'inlines a resource and falls back to `url()`'),
'type': 'url'
},
{
'name': 'length',
'example': 'length(@list);',
'description': localize('less.builtin.length', 'returns the number of elements in a value list')
},
{
'name': 'extract',
'example': 'extract(@list, index);',
'description': localize('less.builtin.extract', 'returns a value at the specified position in the list')
},
{
'name': 'abs',
'description': localize('less.builtin.abs', 'absolute value of a number'),
'example': 'abs(number);'
},
{
'name': 'acos',
'description': localize('less.builtin.acos', 'arccosine - inverse of cosine function'),
'example': 'acos(number);'
},
{
'name': 'asin',
'description': localize('less.builtin.asin', 'arcsine - inverse of sine function'),
'example': 'asin(number);'
},
{
'name': 'ceil',
'example': 'ceil(@number);',
'description': localize('less.builtin.ceil', 'rounds up to an integer')
},
{
'name': 'cos',
'description': localize('less.builtin.cos', 'cosine function'),
'example': 'cos(number);'
},
{
'name': 'floor',
'description': localize('less.builtin.floor', 'rounds down to an integer'),
'example': 'floor(@number);'
},
{
'name': 'percentage',
'description': localize('less.builtin.percentage', 'converts to a %, e.g. 0.5 > 50%'),
'example': 'percentage(@number);',
'type': 'percentage'
},
{
'name': 'round',
'description': localize('less.builtin.round', 'rounds a number to a number of places'),
'example': 'round(number, [places: 0]);'
},
{
'name': 'sqrt',
'description': localize('less.builtin.sqrt', 'calculates square root of a number'),
'example': 'sqrt(number);'
},
{
'name': 'sin',
'description': localize('less.builtin.sin', 'sine function'),
'example': 'sin(number);'
},
{
'name': 'tan',
'description': localize('less.builtin.tan', 'tangent function'),
'example': 'tan(number);'
},
{
'name': 'atan',
'description': localize('less.builtin.atan', 'arctangent - inverse of tangent function'),
'example': 'atan(number);'
},
{
'name': 'pi',
'description': localize('less.builtin.pi', 'returns pi'),
'example': 'pi();'
},
{
'name': 'pow',
'description': localize('less.builtin.pow', 'first argument raised to the power of the second argument'),
'example': 'pow(@base, @exponent);'
},
{
'name': 'mod',
'description': localize('less.builtin.mod', 'first argument modulus second argument'),
'example': 'mod(number, number);'
},
{
'name': 'min',
'description': localize('less.builtin.min', 'returns the lowest of one or more values'),
'example': 'min(@x, @y);'
},
{
'name': 'max',
'description': localize('less.builtin.max', 'returns the lowest of one or more values'),
'example': 'max(@x, @y);'
}
];
LESSCompletion.colorProposals = [
{
'name': 'argb',
'example': 'argb(@color);',
'description': localize('less.builtin.argb', 'creates a #AARRGGBB')
},
{
'name': 'hsl',
'example': 'hsl(@hue, @saturation, @lightness);',
'description': localize('less.builtin.hsl', 'creates a color')
},
{
'name': 'hsla',
'example': 'hsla(@hue, @saturation, @lightness, @alpha);',
'description': localize('less.builtin.hsla', 'creates a color')
},
{
'name': 'hsv',
'example': 'hsv(@hue, @saturation, @value);',
'description': localize('less.builtin.hsv', 'creates a color')
},
{
'name': 'hsva',
'example': 'hsva(@hue, @saturation, @value, @alpha);',
'description': localize('less.builtin.hsva', 'creates a color')
},
{
'name': 'hue',
'example': 'hue(@color);',
'description': localize('less.builtin.hue', 'returns the `hue` channel of `@color` in the HSL space')
},
{
'name': 'saturation',
'example': 'saturation(@color);',
'description': localize('less.builtin.saturation', 'returns the `saturation` channel of `@color` in the HSL space')
},
{
'name': 'lightness',
'example': 'lightness(@color);',
'description': localize('less.builtin.lightness', 'returns the `lightness` channel of `@color` in the HSL space')
},
{
'name': 'hsvhue',
'example': 'hsvhue(@color);',
'description': localize('less.builtin.hsvhue', 'returns the `hue` channel of `@color` in the HSV space')
},
{
'name': 'hsvsaturation',
'example': 'hsvsaturation(@color);',
'description': localize('less.builtin.hsvsaturation', 'returns the `saturation` channel of `@color` in the HSV space')
},
{
'name': 'hsvvalue',
'example': 'hsvvalue(@color);',
'description': localize('less.builtin.hsvvalue', 'returns the `value` channel of `@color` in the HSV space')
},
{
'name': 'red',
'example': 'red(@color);',
'description': localize('less.builtin.red', 'returns the `red` channel of `@color`')
},
{
'name': 'green',
'example': 'green(@color);',
'description': localize('less.builtin.green', 'returns the `green` channel of `@color`')
},
{
'name': 'blue',
'example': 'blue(@color);',
'description': localize('less.builtin.blue', 'returns the `blue` channel of `@color`')
},
{
'name': 'alpha',
'example': 'alpha(@color);',
'description': localize('less.builtin.alpha', 'returns the `alpha` channel of `@color`')
},
{
'name': 'luma',
'example': 'luma(@color);',
'description': localize('less.builtin.luma', 'returns the `luma` value (perceptual brightness) of `@color`')
},
{
'name': 'saturate',
'example': 'saturate(@color, 10%);',
'description': localize('less.builtin.saturate', 'return `@color` 10% points more saturated')
},
{
'name': 'desaturate',
'example': 'desaturate(@color, 10%);',
'description': localize('less.builtin.desaturate', 'return `@color` 10% points less saturated')
},
{
'name': 'lighten',
'example': 'lighten(@color, 10%);',
'description': localize('less.builtin.lighten', 'return `@color` 10% points lighter')
},
{
'name': 'darken',
'example': 'darken(@color, 10%);',
'description': localize('less.builtin.darken', 'return `@color` 10% points darker')
},
{
'name': 'fadein',
'example': 'fadein(@color, 10%);',
'description': localize('less.builtin.fadein', 'return `@color` 10% points less transparent')
},
{
'name': 'fadeout',
'example': 'fadeout(@color, 10%);',
'description': localize('less.builtin.fadeout', 'return `@color` 10% points more transparent')
},
{
'name': 'fade',
'example': 'fade(@color, 50%);',
'description': localize('less.builtin.fade', 'return `@color` with 50% transparency')
},
{
'name': 'spin',
'example': 'spin(@color, 10);',
'description': localize('less.builtin.spin', 'return `@color` with a 10 degree larger in hue')
},
{
'name': 'mix',
'example': 'mix(@color1, @color2, [@weight: 50%]);',
'description': localize('less.builtin.mix', 'return a mix of `@color1` and `@color2`')
},
{
'name': 'greyscale',
'example': 'greyscale(@color);',
'description': localize('less.builtin.greyscale', 'returns a grey, 100% desaturated color'),
},
{
'name': 'contrast',
'example': 'contrast(@color1, [@darkcolor: black], [@lightcolor: white], [@threshold: 43%]);',
'description': localize('less.builtin.contrast', 'return `@darkcolor` if `@color1 is> 43% luma` otherwise return `@lightcolor`, see notes')
},
{
'name': 'multiply',
'example': 'multiply(@color1, @color2);'
},
{
'name': 'screen',
'example': 'screen(@color1, @color2);'
},
{
'name': 'overlay',
'example': 'overlay(@color1, @color2);'
},
{
'name': 'softlight',
'example': 'softlight(@color1, @color2);'
},
{
'name': 'hardlight',
'example': 'hardlight(@color1, @color2);'
},
{
'name': 'difference',
'example': 'difference(@color1, @color2);'
},
{
'name': 'exclusion',
'example': 'exclusion(@color1, @color2);'
},
{
'name': 'average',
'example': 'average(@color1, @color2);'
},
{
'name': 'negation',
'example': 'negation(@color1, @color2);'
}
];
exports.LESSCompletion = LESSCompletion;
});
//# sourceMappingURL=lessCompletion.js.map

@@ -21,3 +21,3 @@ (function (factory) {

var localize = nls.loadMessageBundle();
var Element = (function () {
var Element = /** @class */ (function () {
function Element(text, data) {

@@ -29,3 +29,3 @@ this.name = text;

}());
var NodesByRootMap = (function () {
var NodesByRootMap = /** @class */ (function () {
function NodesByRootMap() {

@@ -47,3 +47,3 @@ this.data = {};

}());
var LintVisitor = (function () {
var LintVisitor = /** @class */ (function () {
function LintVisitor(settings) {

@@ -524,9 +524,9 @@ this.warnings = [];

};
LintVisitor.prefixes = [
'-ms-', '-moz-', '-o-', '-webkit-',
];
return LintVisitor;
}());
LintVisitor.prefixes = [
'-ms-', '-moz-', '-o-', '-webkit-',
];
exports.LintVisitor = LintVisitor;
});
//# sourceMappingURL=lint.js.map

@@ -22,3 +22,3 @@ (function (factory) {

var Ignore = nodes.Level.Ignore;
var Rule = (function () {
var Rule = /** @class */ (function () {
function Rule(id, message, defaultValue) {

@@ -53,3 +53,3 @@ this.id = id;

};
var LintConfigurationSettings = (function () {
var LintConfigurationSettings = /** @class */ (function () {
function LintConfigurationSettings(conf) {

@@ -56,0 +56,0 @@ if (conf === void 0) { conf = {}; }

@@ -30,3 +30,3 @@ var __extends = (this && this.__extends) || (function () {

var localize = nls.loadMessageBundle();
var SCSSCompletion = (function (_super) {
var SCSSCompletion = /** @class */ (function (_super) {
__extends(SCSSCompletion, _super);

@@ -82,105 +82,105 @@ function SCSSCompletion() {

};
SCSSCompletion.variableDefaults = {
'$red': '1',
'$green': '2',
'$blue': '3',
'$alpha': '1.0',
'$color': '$color',
'$weight': '0.5',
'$hue': '0',
'$saturation': '0%',
'$lightness': '0%',
'$degrees': '0',
'$amount': '0',
'$string': '""',
'$substring': '"s"',
'$number': '0',
'$limit': '1'
};
SCSSCompletion.colorProposals = [
{ func: 'red($color)', desc: localize('scss.builtin.red', 'Gets the red component of a color.') },
{ func: 'green($color)', desc: localize('scss.builtin.green', 'Gets the green component of a color.') },
{ func: 'blue($color)', desc: localize('scss.builtin.blue', 'Gets the blue component of a color.') },
{ func: 'mix($color, $color, [$weight])', desc: localize('scss.builtin.mix', 'Mixes two colors together.') },
{ func: 'hue($color)', desc: localize('scss.builtin.hue', 'Gets the hue component of a color.') },
{ func: 'saturation($color)', desc: localize('scss.builtin.saturation', 'Gets the saturation component of a color.') },
{ func: 'lightness($color)', desc: localize('scss.builtin.lightness', 'Gets the lightness component of a color.') },
{ func: 'adjust-hue($color, $degrees)', desc: localize('scss.builtin.adjust-hue', 'Changes the hue of a color.') },
{ func: 'lighten($color, $amount)', desc: localize('scss.builtin.lighten', 'Makes a color lighter.') },
{ func: 'darken($color, $amount)', desc: localize('scss.builtin.darken', 'Makes a color darker.') },
{ func: 'saturate($color, $amount)', desc: localize('scss.builtin.saturate', 'Makes a color more saturated.') },
{ func: 'desaturate($color, $amount)', desc: localize('scss.builtin.desaturate', 'Makes a color less saturated.') },
{ func: 'grayscale($color)', desc: localize('scss.builtin.grayscale', 'Converts a color to grayscale.') },
{ func: 'complement($color)', desc: localize('scss.builtin.complement', 'Returns the complement of a color.') },
{ func: 'invert($color)', desc: localize('scss.builtin.invert', 'Returns the inverse of a color.') },
{ func: 'alpha($color)', desc: localize('scss.builtin.alpha', 'Gets the opacity component of a color.') },
{ func: 'opacity($color)', desc: 'Gets the alpha component (opacity) of a color.' },
{ func: 'rgba($color, $alpha)', desc: localize('scss.builtin.rgba', 'Changes the alpha component for a color.') },
{ func: 'opacify($color, $amount)', desc: localize('scss.builtin.opacify', 'Makes a color more opaque.') },
{ func: 'fade-in($color, $amount)', desc: localize('scss.builtin.fade-in', 'Makes a color more opaque.') },
{ func: 'transparentize($color, $amount)', desc: localize('scss.builtin.transparentize', 'Makes a color more transparent.') },
{ func: 'fade-out($color, $amount)', desc: localize('scss.builtin.fade-out', 'Makes a color more transparent.') },
{ func: 'adjust-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])', desc: localize('scss.builtin.adjust-color', 'Increases or decreases one or more components of a color.') },
{ func: 'scale-color($color, [$red], [$green], [$blue], [$saturation], [$lightness], [$alpha])', desc: localize('scss.builtin.scale-color', 'Fluidly scales one or more properties of a color.') },
{ func: 'change-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])', desc: localize('scss.builtin.change-color', 'Changes one or more properties of a color.') },
{ func: 'ie-hex-str($color)', desc: localize('scss.builtin.ie-hex-str', 'Converts a color into the format understood by IE filters.') }
];
SCSSCompletion.selectorFuncs = [
{ func: 'selector-nest($selectors…)', desc: localize('scss.builtin.selector-nest', 'Nests selector beneath one another like they would be nested in the stylesheet.') },
{ func: 'selector-append($selectors…)', desc: localize('scss.builtin.selector-append', 'Appends selectors to one another without spaces in between.') },
{ func: 'selector-extend($selector, $extendee, $extender)', desc: localize('scss.builtin.selector-extend', 'Extends $extendee with $extender within $selector.') },
{ func: 'selector-replace($selector, $original, $replacement)', desc: localize('scss.builtin.selector-replace', 'Replaces $original with $replacement within $selector.') },
{ func: 'selector-unify($selector1, $selector2)', desc: localize('scss.builtin.selector-unify', 'Unifies two selectors to produce a selector that matches elements matched by both.') },
{ func: 'is-superselector($super, $sub)', desc: localize('scss.builtin.is-superselector', 'Returns whether $super matches all the elements $sub does, and possibly more.') },
{ func: 'simple-selectors($selector)', desc: localize('scss.builtin.simple-selectors', 'Returns the simple selectors that comprise a compound selector.') },
{ func: 'selector-parse($selector)', desc: localize('scss.builtin.selector-parse', 'Parses a selector into the format returned by &.') }
];
SCSSCompletion.builtInFuncs = [
{ func: 'unquote($string)', desc: localize('scss.builtin.unquote', 'Removes quotes from a string.') },
{ func: 'quote($string)', desc: localize('scss.builtin.quote', 'Adds quotes to a string.') },
{ func: 'str-length($string)', desc: localize('scss.builtin.str-length', 'Returns the number of characters in a string.') },
{ func: 'str-insert($string, $insert, $index)', desc: localize('scss.builtin.str-insert', 'Inserts $insert into $string at $index.') },
{ func: 'str-index($string, $substring)', desc: localize('scss.builtin.str-index', 'Returns the index of the first occurance of $substring in $string.') },
{ func: 'str-slice($string, $start-at, [$end-at])', desc: localize('scss.builtin.str-slice', 'Extracts a substring from $string.') },
{ func: 'to-upper-case($string)', desc: localize('scss.builtin.to-upper-case', 'Converts a string to upper case.') },
{ func: 'to-lower-case($string)', desc: localize('scss.builtin.to-lower-case', 'Converts a string to lower case.') },
{ func: 'percentage($number)', desc: localize('scss.builtin.percentage', 'Converts a unitless number to a percentage.'), type: 'percentage' },
{ func: 'round($number)', desc: localize('scss.builtin.round', 'Rounds a number to the nearest whole number.') },
{ func: 'ceil($number)', desc: localize('scss.builtin.ceil', 'Rounds a number up to the next whole number.') },
{ func: 'floor($number)', desc: localize('scss.builtin.floor', 'Rounds a number down to the previous whole number.') },
{ func: 'abs($number)', desc: localize('scss.builtin.abs', 'Returns the absolute value of a number.') },
{ func: 'min($numbers)', desc: localize('scss.builtin.min', 'Finds the minimum of several numbers.') },
{ func: 'max($numbers)', desc: localize('scss.builtin.max', 'Finds the maximum of several numbers.') },
{ func: 'random([$limit])', desc: localize('scss.builtin.random', 'Returns a random number.') },
{ func: 'length($list)', desc: localize('scss.builtin.length', 'Returns the length of a list.') },
{ func: 'nth($list, $n)', desc: localize('scss.builtin.nth', 'Returns a specific item in a list.') },
{ func: 'set-nth($list, $n, $value)', desc: localize('scss.builtin.set-nth', 'Replaces the nth item in a list.') },
{ func: 'join($list1, $list2, [$separator])', desc: localize('scss.builtin.join', 'Joins together two lists into one.') },
{ func: 'append($list1, $val, [$separator])', desc: localize('scss.builtin.append', 'Appends a single value onto the end of a list.') },
{ func: 'zip($lists)', desc: localize('scss.builtin.zip', 'Combines several lists into a single multidimensional list.') },
{ func: 'index($list, $value)', desc: localize('scss.builtin.index', 'Returns the position of a value within a list.') },
{ func: 'list-separator(#list)', desc: localize('scss.builtin.list-separator', 'Returns the separator of a list.') },
{ func: 'map-get($map, $key)', desc: localize('scss.builtin.map-get', 'Returns the value in a map associated with a given key.') },
{ func: 'map-merge($map1, $map2)', desc: localize('scss.builtin.map-merge', 'Merges two maps together into a new map.') },
{ func: 'map-remove($map, $keys)', desc: localize('scss.builtin.map-remove', 'Returns a new map with keys removed.') },
{ func: 'map-keys($map)', desc: localize('scss.builtin.map-keys', 'Returns a list of all keys in a map.') },
{ func: 'map-values($map)', desc: localize('scss.builtin.map-values', 'Returns a list of all values in a map.') },
{ func: 'map-has-key($map, $key)', desc: localize('scss.builtin.map-has-key', 'Returns whether a map has a value associated with a given key.') },
{ func: 'keywords($args)', desc: localize('scss.builtin.keywords', 'Returns the keywords passed to a function that takes variable arguments.') },
{ func: 'feature-exists($feature)', desc: localize('scss.builtin.feature-exists', 'Returns whether a feature exists in the current Sass runtime.') },
{ func: 'variable-exists($name)', desc: localize('scss.builtin.variable-exists', 'Returns whether a variable with the given name exists in the current scope.') },
{ func: 'global-variable-exists($name)', desc: localize('scss.builtin.global-variable-exists', 'Returns whether a variable with the given name exists in the global scope.') },
{ func: 'function-exists($name)', desc: localize('scss.builtin.function-exists', 'Returns whether a function with the given name exists.') },
{ func: 'mixin-exists($name)', desc: localize('scss.builtin.mixin-exists', 'Returns whether a mixin with the given name exists.') },
{ func: 'inspect($value)', desc: localize('scss.builtin.inspect', 'Returns the string representation of a value as it would be represented in Sass.') },
{ func: 'type-of($value)', desc: localize('scss.builtin.type-of', 'Returns the type of a value.') },
{ func: 'unit($number)', desc: localize('scss.builtin.unit', 'Returns the unit(s) associated with a number.') },
{ func: 'unitless($number)', desc: localize('scss.builtin.unitless', 'Returns whether a number has units.') },
{ func: 'comparable($number1, $number2)', desc: localize('scss.builtin.comparable', 'Returns whether two numbers can be added, subtracted, or compared.') },
{ func: 'call($name, $args…)', desc: localize('scss.builtin.call', 'Dynamically calls a Sass function.') }
];
return SCSSCompletion;
}(cssCompletion_1.CSSCompletion));
SCSSCompletion.variableDefaults = {
'$red': '1',
'$green': '2',
'$blue': '3',
'$alpha': '1.0',
'$color': '$color',
'$weight': '0.5',
'$hue': '0',
'$saturation': '0%',
'$lightness': '0%',
'$degrees': '0',
'$amount': '0',
'$string': '""',
'$substring': '"s"',
'$number': '0',
'$limit': '1'
};
SCSSCompletion.colorProposals = [
{ func: 'red($color)', desc: localize('scss.builtin.red', 'Gets the red component of a color.') },
{ func: 'green($color)', desc: localize('scss.builtin.green', 'Gets the green component of a color.') },
{ func: 'blue($color)', desc: localize('scss.builtin.blue', 'Gets the blue component of a color.') },
{ func: 'mix($color, $color, [$weight])', desc: localize('scss.builtin.mix', 'Mixes two colors together.') },
{ func: 'hue($color)', desc: localize('scss.builtin.hue', 'Gets the hue component of a color.') },
{ func: 'saturation($color)', desc: localize('scss.builtin.saturation', 'Gets the saturation component of a color.') },
{ func: 'lightness($color)', desc: localize('scss.builtin.lightness', 'Gets the lightness component of a color.') },
{ func: 'adjust-hue($color, $degrees)', desc: localize('scss.builtin.adjust-hue', 'Changes the hue of a color.') },
{ func: 'lighten($color, $amount)', desc: localize('scss.builtin.lighten', 'Makes a color lighter.') },
{ func: 'darken($color, $amount)', desc: localize('scss.builtin.darken', 'Makes a color darker.') },
{ func: 'saturate($color, $amount)', desc: localize('scss.builtin.saturate', 'Makes a color more saturated.') },
{ func: 'desaturate($color, $amount)', desc: localize('scss.builtin.desaturate', 'Makes a color less saturated.') },
{ func: 'grayscale($color)', desc: localize('scss.builtin.grayscale', 'Converts a color to grayscale.') },
{ func: 'complement($color)', desc: localize('scss.builtin.complement', 'Returns the complement of a color.') },
{ func: 'invert($color)', desc: localize('scss.builtin.invert', 'Returns the inverse of a color.') },
{ func: 'alpha($color)', desc: localize('scss.builtin.alpha', 'Gets the opacity component of a color.') },
{ func: 'opacity($color)', desc: 'Gets the alpha component (opacity) of a color.' },
{ func: 'rgba($color, $alpha)', desc: localize('scss.builtin.rgba', 'Changes the alpha component for a color.') },
{ func: 'opacify($color, $amount)', desc: localize('scss.builtin.opacify', 'Makes a color more opaque.') },
{ func: 'fade-in($color, $amount)', desc: localize('scss.builtin.fade-in', 'Makes a color more opaque.') },
{ func: 'transparentize($color, $amount)', desc: localize('scss.builtin.transparentize', 'Makes a color more transparent.') },
{ func: 'fade-out($color, $amount)', desc: localize('scss.builtin.fade-out', 'Makes a color more transparent.') },
{ func: 'adjust-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])', desc: localize('scss.builtin.adjust-color', 'Increases or decreases one or more components of a color.') },
{ func: 'scale-color($color, [$red], [$green], [$blue], [$saturation], [$lightness], [$alpha])', desc: localize('scss.builtin.scale-color', 'Fluidly scales one or more properties of a color.') },
{ func: 'change-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])', desc: localize('scss.builtin.change-color', 'Changes one or more properties of a color.') },
{ func: 'ie-hex-str($color)', desc: localize('scss.builtin.ie-hex-str', 'Converts a color into the format understood by IE filters.') }
];
SCSSCompletion.selectorFuncs = [
{ func: 'selector-nest($selectors…)', desc: localize('scss.builtin.selector-nest', 'Nests selector beneath one another like they would be nested in the stylesheet.') },
{ func: 'selector-append($selectors…)', desc: localize('scss.builtin.selector-append', 'Appends selectors to one another without spaces in between.') },
{ func: 'selector-extend($selector, $extendee, $extender)', desc: localize('scss.builtin.selector-extend', 'Extends $extendee with $extender within $selector.') },
{ func: 'selector-replace($selector, $original, $replacement)', desc: localize('scss.builtin.selector-replace', 'Replaces $original with $replacement within $selector.') },
{ func: 'selector-unify($selector1, $selector2)', desc: localize('scss.builtin.selector-unify', 'Unifies two selectors to produce a selector that matches elements matched by both.') },
{ func: 'is-superselector($super, $sub)', desc: localize('scss.builtin.is-superselector', 'Returns whether $super matches all the elements $sub does, and possibly more.') },
{ func: 'simple-selectors($selector)', desc: localize('scss.builtin.simple-selectors', 'Returns the simple selectors that comprise a compound selector.') },
{ func: 'selector-parse($selector)', desc: localize('scss.builtin.selector-parse', 'Parses a selector into the format returned by &.') }
];
SCSSCompletion.builtInFuncs = [
{ func: 'unquote($string)', desc: localize('scss.builtin.unquote', 'Removes quotes from a string.') },
{ func: 'quote($string)', desc: localize('scss.builtin.quote', 'Adds quotes to a string.') },
{ func: 'str-length($string)', desc: localize('scss.builtin.str-length', 'Returns the number of characters in a string.') },
{ func: 'str-insert($string, $insert, $index)', desc: localize('scss.builtin.str-insert', 'Inserts $insert into $string at $index.') },
{ func: 'str-index($string, $substring)', desc: localize('scss.builtin.str-index', 'Returns the index of the first occurance of $substring in $string.') },
{ func: 'str-slice($string, $start-at, [$end-at])', desc: localize('scss.builtin.str-slice', 'Extracts a substring from $string.') },
{ func: 'to-upper-case($string)', desc: localize('scss.builtin.to-upper-case', 'Converts a string to upper case.') },
{ func: 'to-lower-case($string)', desc: localize('scss.builtin.to-lower-case', 'Converts a string to lower case.') },
{ func: 'percentage($number)', desc: localize('scss.builtin.percentage', 'Converts a unitless number to a percentage.'), type: 'percentage' },
{ func: 'round($number)', desc: localize('scss.builtin.round', 'Rounds a number to the nearest whole number.') },
{ func: 'ceil($number)', desc: localize('scss.builtin.ceil', 'Rounds a number up to the next whole number.') },
{ func: 'floor($number)', desc: localize('scss.builtin.floor', 'Rounds a number down to the previous whole number.') },
{ func: 'abs($number)', desc: localize('scss.builtin.abs', 'Returns the absolute value of a number.') },
{ func: 'min($numbers)', desc: localize('scss.builtin.min', 'Finds the minimum of several numbers.') },
{ func: 'max($numbers)', desc: localize('scss.builtin.max', 'Finds the maximum of several numbers.') },
{ func: 'random([$limit])', desc: localize('scss.builtin.random', 'Returns a random number.') },
{ func: 'length($list)', desc: localize('scss.builtin.length', 'Returns the length of a list.') },
{ func: 'nth($list, $n)', desc: localize('scss.builtin.nth', 'Returns a specific item in a list.') },
{ func: 'set-nth($list, $n, $value)', desc: localize('scss.builtin.set-nth', 'Replaces the nth item in a list.') },
{ func: 'join($list1, $list2, [$separator])', desc: localize('scss.builtin.join', 'Joins together two lists into one.') },
{ func: 'append($list1, $val, [$separator])', desc: localize('scss.builtin.append', 'Appends a single value onto the end of a list.') },
{ func: 'zip($lists)', desc: localize('scss.builtin.zip', 'Combines several lists into a single multidimensional list.') },
{ func: 'index($list, $value)', desc: localize('scss.builtin.index', 'Returns the position of a value within a list.') },
{ func: 'list-separator(#list)', desc: localize('scss.builtin.list-separator', 'Returns the separator of a list.') },
{ func: 'map-get($map, $key)', desc: localize('scss.builtin.map-get', 'Returns the value in a map associated with a given key.') },
{ func: 'map-merge($map1, $map2)', desc: localize('scss.builtin.map-merge', 'Merges two maps together into a new map.') },
{ func: 'map-remove($map, $keys)', desc: localize('scss.builtin.map-remove', 'Returns a new map with keys removed.') },
{ func: 'map-keys($map)', desc: localize('scss.builtin.map-keys', 'Returns a list of all keys in a map.') },
{ func: 'map-values($map)', desc: localize('scss.builtin.map-values', 'Returns a list of all values in a map.') },
{ func: 'map-has-key($map, $key)', desc: localize('scss.builtin.map-has-key', 'Returns whether a map has a value associated with a given key.') },
{ func: 'keywords($args)', desc: localize('scss.builtin.keywords', 'Returns the keywords passed to a function that takes variable arguments.') },
{ func: 'feature-exists($feature)', desc: localize('scss.builtin.feature-exists', 'Returns whether a feature exists in the current Sass runtime.') },
{ func: 'variable-exists($name)', desc: localize('scss.builtin.variable-exists', 'Returns whether a variable with the given name exists in the current scope.') },
{ func: 'global-variable-exists($name)', desc: localize('scss.builtin.global-variable-exists', 'Returns whether a variable with the given name exists in the global scope.') },
{ func: 'function-exists($name)', desc: localize('scss.builtin.function-exists', 'Returns whether a function with the given name exists.') },
{ func: 'mixin-exists($name)', desc: localize('scss.builtin.mixin-exists', 'Returns whether a mixin with the given name exists.') },
{ func: 'inspect($value)', desc: localize('scss.builtin.inspect', 'Returns the string representation of a value as it would be represented in Sass.') },
{ func: 'type-of($value)', desc: localize('scss.builtin.type-of', 'Returns the type of a value.') },
{ func: 'unit($number)', desc: localize('scss.builtin.unit', 'Returns the unit(s) associated with a number.') },
{ func: 'unitless($number)', desc: localize('scss.builtin.unitless', 'Returns whether a number has units.') },
{ func: 'comparable($number1, $number2)', desc: localize('scss.builtin.comparable', 'Returns whether two numbers can be added, subtracted, or compared.') },
{ func: 'call($name, $args…)', desc: localize('scss.builtin.call', 'Dynamically calls a Sass function.') }
];
exports.SCSSCompletion = SCSSCompletion;
});
//# sourceMappingURL=scssCompletion.js.map

@@ -27,3 +27,3 @@ var __extends = (this && this.__extends) || (function () {

var nodes = require("../parser/cssNodes");
var Element = (function () {
var Element = /** @class */ (function () {
function Element() {

@@ -122,3 +122,3 @@ }

exports.Element = Element;
var RootElement = (function (_super) {
var RootElement = /** @class */ (function (_super) {
__extends(RootElement, _super);

@@ -131,3 +131,3 @@ function RootElement() {

exports.RootElement = RootElement;
var LabelElement = (function (_super) {
var LabelElement = /** @class */ (function (_super) {
__extends(LabelElement, _super);

@@ -142,3 +142,3 @@ function LabelElement(label) {

exports.LabelElement = LabelElement;
var MarkedStringPrinter = (function () {
var MarkedStringPrinter = /** @class */ (function () {
function MarkedStringPrinter(quote) {

@@ -320,3 +320,3 @@ this.quote = quote;

exports.simpleSelectorToMarkedString = simpleSelectorToMarkedString;
var SelectorElementBuilder = (function () {
var SelectorElementBuilder = /** @class */ (function () {
function SelectorElementBuilder(element) {

@@ -323,0 +323,0 @@ this.prev = null;

{
"name": "vscode-css-languageservice",
"version": "2.1.4",
"version": "2.1.5",
"description": "Language service for CSS, LESS and SCSS",

@@ -23,7 +23,7 @@ "main": "./lib/cssLanguageService.js",

"mocha": "^2.4.5",
"typescript": "^2.1.5",
"typescript": "^2.5.2",
"xml2js": "^0.4.16"
},
"dependencies": {
"vscode-languageserver-types": "^3.3.0-alpha.1",
"vscode-languageserver-types": "^3.3.0",
"vscode-nls": "^2.0.1"

@@ -30,0 +30,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc