vscode-css-languageservice
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -15,2 +15,3 @@ (function (factory) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var cssParser_1 = require("./parser/cssParser"); | ||
@@ -17,0 +18,0 @@ var cssCompletion_1 = require("./services/cssCompletion"); |
@@ -15,2 +15,3 @@ (function (factory) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var nls = require("vscode-nls"); | ||
@@ -54,5 +55,5 @@ var localize = nls.loadMessageBundle(); | ||
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")) | ||
}; | ||
}); | ||
//# sourceMappingURL=cssErrors.js.map |
@@ -1,6 +0,11 @@ | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
(function (factory) { | ||
@@ -20,2 +25,3 @@ if (typeof module === "object" && typeof module.exports === "object") { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/// <summary> | ||
@@ -38,57 +44,58 @@ /// Nodes for the css 2.1 specification. See for reference: | ||
NodeType[NodeType["SelectorCombinatorAllSiblings"] = 10] = "SelectorCombinatorAllSiblings"; | ||
NodeType[NodeType["Page"] = 11] = "Page"; | ||
NodeType[NodeType["PageBoxMarginBox"] = 12] = "PageBoxMarginBox"; | ||
NodeType[NodeType["ClassSelector"] = 13] = "ClassSelector"; | ||
NodeType[NodeType["IdentifierSelector"] = 14] = "IdentifierSelector"; | ||
NodeType[NodeType["ElementNameSelector"] = 15] = "ElementNameSelector"; | ||
NodeType[NodeType["PseudoSelector"] = 16] = "PseudoSelector"; | ||
NodeType[NodeType["AttributeSelector"] = 17] = "AttributeSelector"; | ||
NodeType[NodeType["Declaration"] = 18] = "Declaration"; | ||
NodeType[NodeType["Declarations"] = 19] = "Declarations"; | ||
NodeType[NodeType["Property"] = 20] = "Property"; | ||
NodeType[NodeType["Expression"] = 21] = "Expression"; | ||
NodeType[NodeType["BinaryExpression"] = 22] = "BinaryExpression"; | ||
NodeType[NodeType["Term"] = 23] = "Term"; | ||
NodeType[NodeType["Operator"] = 24] = "Operator"; | ||
NodeType[NodeType["Value"] = 25] = "Value"; | ||
NodeType[NodeType["StringLiteral"] = 26] = "StringLiteral"; | ||
NodeType[NodeType["URILiteral"] = 27] = "URILiteral"; | ||
NodeType[NodeType["EscapedValue"] = 28] = "EscapedValue"; | ||
NodeType[NodeType["Function"] = 29] = "Function"; | ||
NodeType[NodeType["NumericValue"] = 30] = "NumericValue"; | ||
NodeType[NodeType["HexColorValue"] = 31] = "HexColorValue"; | ||
NodeType[NodeType["MixinDeclaration"] = 32] = "MixinDeclaration"; | ||
NodeType[NodeType["MixinReference"] = 33] = "MixinReference"; | ||
NodeType[NodeType["VariableName"] = 34] = "VariableName"; | ||
NodeType[NodeType["VariableDeclaration"] = 35] = "VariableDeclaration"; | ||
NodeType[NodeType["Prio"] = 36] = "Prio"; | ||
NodeType[NodeType["Interpolation"] = 37] = "Interpolation"; | ||
NodeType[NodeType["NestedProperties"] = 38] = "NestedProperties"; | ||
NodeType[NodeType["ExtendsReference"] = 39] = "ExtendsReference"; | ||
NodeType[NodeType["SelectorPlaceholder"] = 40] = "SelectorPlaceholder"; | ||
NodeType[NodeType["Debug"] = 41] = "Debug"; | ||
NodeType[NodeType["If"] = 42] = "If"; | ||
NodeType[NodeType["Else"] = 43] = "Else"; | ||
NodeType[NodeType["For"] = 44] = "For"; | ||
NodeType[NodeType["Each"] = 45] = "Each"; | ||
NodeType[NodeType["While"] = 46] = "While"; | ||
NodeType[NodeType["MixinContent"] = 47] = "MixinContent"; | ||
NodeType[NodeType["Media"] = 48] = "Media"; | ||
NodeType[NodeType["Keyframe"] = 49] = "Keyframe"; | ||
NodeType[NodeType["FontFace"] = 50] = "FontFace"; | ||
NodeType[NodeType["Import"] = 51] = "Import"; | ||
NodeType[NodeType["Namespace"] = 52] = "Namespace"; | ||
NodeType[NodeType["Invocation"] = 53] = "Invocation"; | ||
NodeType[NodeType["FunctionDeclaration"] = 54] = "FunctionDeclaration"; | ||
NodeType[NodeType["ReturnStatement"] = 55] = "ReturnStatement"; | ||
NodeType[NodeType["MediaQuery"] = 56] = "MediaQuery"; | ||
NodeType[NodeType["FunctionParameter"] = 57] = "FunctionParameter"; | ||
NodeType[NodeType["FunctionArgument"] = 58] = "FunctionArgument"; | ||
NodeType[NodeType["KeyframeSelector"] = 59] = "KeyframeSelector"; | ||
NodeType[NodeType["ViewPort"] = 60] = "ViewPort"; | ||
NodeType[NodeType["Document"] = 61] = "Document"; | ||
NodeType[NodeType["AtApplyRule"] = 62] = "AtApplyRule"; | ||
NodeType[NodeType["CustomPropertyDeclaration"] = 63] = "CustomPropertyDeclaration"; | ||
NodeType[NodeType["CustomPropertySet"] = 64] = "CustomPropertySet"; | ||
NodeType[NodeType["ListEntry"] = 65] = "ListEntry"; | ||
NodeType[NodeType["SelectorCombinatorShadowPiercingDescendant"] = 11] = "SelectorCombinatorShadowPiercingDescendant"; | ||
NodeType[NodeType["Page"] = 12] = "Page"; | ||
NodeType[NodeType["PageBoxMarginBox"] = 13] = "PageBoxMarginBox"; | ||
NodeType[NodeType["ClassSelector"] = 14] = "ClassSelector"; | ||
NodeType[NodeType["IdentifierSelector"] = 15] = "IdentifierSelector"; | ||
NodeType[NodeType["ElementNameSelector"] = 16] = "ElementNameSelector"; | ||
NodeType[NodeType["PseudoSelector"] = 17] = "PseudoSelector"; | ||
NodeType[NodeType["AttributeSelector"] = 18] = "AttributeSelector"; | ||
NodeType[NodeType["Declaration"] = 19] = "Declaration"; | ||
NodeType[NodeType["Declarations"] = 20] = "Declarations"; | ||
NodeType[NodeType["Property"] = 21] = "Property"; | ||
NodeType[NodeType["Expression"] = 22] = "Expression"; | ||
NodeType[NodeType["BinaryExpression"] = 23] = "BinaryExpression"; | ||
NodeType[NodeType["Term"] = 24] = "Term"; | ||
NodeType[NodeType["Operator"] = 25] = "Operator"; | ||
NodeType[NodeType["Value"] = 26] = "Value"; | ||
NodeType[NodeType["StringLiteral"] = 27] = "StringLiteral"; | ||
NodeType[NodeType["URILiteral"] = 28] = "URILiteral"; | ||
NodeType[NodeType["EscapedValue"] = 29] = "EscapedValue"; | ||
NodeType[NodeType["Function"] = 30] = "Function"; | ||
NodeType[NodeType["NumericValue"] = 31] = "NumericValue"; | ||
NodeType[NodeType["HexColorValue"] = 32] = "HexColorValue"; | ||
NodeType[NodeType["MixinDeclaration"] = 33] = "MixinDeclaration"; | ||
NodeType[NodeType["MixinReference"] = 34] = "MixinReference"; | ||
NodeType[NodeType["VariableName"] = 35] = "VariableName"; | ||
NodeType[NodeType["VariableDeclaration"] = 36] = "VariableDeclaration"; | ||
NodeType[NodeType["Prio"] = 37] = "Prio"; | ||
NodeType[NodeType["Interpolation"] = 38] = "Interpolation"; | ||
NodeType[NodeType["NestedProperties"] = 39] = "NestedProperties"; | ||
NodeType[NodeType["ExtendsReference"] = 40] = "ExtendsReference"; | ||
NodeType[NodeType["SelectorPlaceholder"] = 41] = "SelectorPlaceholder"; | ||
NodeType[NodeType["Debug"] = 42] = "Debug"; | ||
NodeType[NodeType["If"] = 43] = "If"; | ||
NodeType[NodeType["Else"] = 44] = "Else"; | ||
NodeType[NodeType["For"] = 45] = "For"; | ||
NodeType[NodeType["Each"] = 46] = "Each"; | ||
NodeType[NodeType["While"] = 47] = "While"; | ||
NodeType[NodeType["MixinContent"] = 48] = "MixinContent"; | ||
NodeType[NodeType["Media"] = 49] = "Media"; | ||
NodeType[NodeType["Keyframe"] = 50] = "Keyframe"; | ||
NodeType[NodeType["FontFace"] = 51] = "FontFace"; | ||
NodeType[NodeType["Import"] = 52] = "Import"; | ||
NodeType[NodeType["Namespace"] = 53] = "Namespace"; | ||
NodeType[NodeType["Invocation"] = 54] = "Invocation"; | ||
NodeType[NodeType["FunctionDeclaration"] = 55] = "FunctionDeclaration"; | ||
NodeType[NodeType["ReturnStatement"] = 56] = "ReturnStatement"; | ||
NodeType[NodeType["MediaQuery"] = 57] = "MediaQuery"; | ||
NodeType[NodeType["FunctionParameter"] = 58] = "FunctionParameter"; | ||
NodeType[NodeType["FunctionArgument"] = 59] = "FunctionArgument"; | ||
NodeType[NodeType["KeyframeSelector"] = 60] = "KeyframeSelector"; | ||
NodeType[NodeType["ViewPort"] = 61] = "ViewPort"; | ||
NodeType[NodeType["Document"] = 62] = "Document"; | ||
NodeType[NodeType["AtApplyRule"] = 63] = "AtApplyRule"; | ||
NodeType[NodeType["CustomPropertyDeclaration"] = 64] = "CustomPropertyDeclaration"; | ||
NodeType[NodeType["CustomPropertySet"] = 65] = "CustomPropertySet"; | ||
NodeType[NodeType["ListEntry"] = 66] = "ListEntry"; | ||
})(NodeType = exports.NodeType || (exports.NodeType = {})); | ||
@@ -95,0 +102,0 @@ var ReferenceType; |
@@ -15,2 +15,3 @@ (function (factory) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var cssScanner_1 = require("./cssScanner"); | ||
@@ -89,2 +90,14 @@ var nodes = require("./cssNodes"); | ||
}; | ||
Parser.prototype.acceptUnquotedString = function () { | ||
var pos = this.scanner.pos(); | ||
this.scanner.goBackTo(this.token.offset); | ||
var unquoted = this.scanner.scanUnquotedString(); | ||
if (unquoted) { | ||
this.token = unquoted; | ||
this.consumeToken(); | ||
return true; | ||
} | ||
this.scanner.goBackTo(pos); | ||
return false; | ||
}; | ||
Parser.prototype.resync = function (resyncTokens, resyncStopTokens) { | ||
@@ -218,2 +231,3 @@ while (true) { | ||
while (this.accept(cssScanner_1.TokenType.Comma) && this._parseSelector(isNested)) { | ||
// loop | ||
} | ||
@@ -235,2 +249,3 @@ if (this.accept(cssScanner_1.TokenType.CurlyL)) { | ||
while (this.accept(cssScanner_1.TokenType.Comma) && node.getSelectors().addChild(this._parseSelector(isNested))) { | ||
// loop | ||
} | ||
@@ -304,2 +319,3 @@ return this._parseBody(node, this._parseRuleSetDeclaration.bind(this)); | ||
while (this.accept(cssScanner_1.TokenType.SemiColon)) { | ||
// accept empty statements | ||
} | ||
@@ -459,4 +475,3 @@ decl = parseDeclaration(); | ||
break; | ||
case cssScanner_1.TokenType.BadString: // fall through | ||
case cssScanner_1.TokenType.BadUri: | ||
case cssScanner_1.TokenType.BadString: | ||
break done; | ||
@@ -525,3 +540,3 @@ case cssScanner_1.TokenType.EOF: | ||
} | ||
if (!this.accept(cssScanner_1.TokenType.URI) && !this.accept(cssScanner_1.TokenType.String)) { | ||
if (!node.addChild(this._parseURILiteral()) && !node.addChild(this._parseStringLiteral())) { | ||
return this.finish(node, cssErrors_1.ParseError.URIOrStringExpected); | ||
@@ -539,5 +554,7 @@ } | ||
} | ||
node.addChild(this._parseIdent()); // optional prefix | ||
if (!this.accept(cssScanner_1.TokenType.URI) && !this.accept(cssScanner_1.TokenType.String)) { | ||
return this.finish(node, cssErrors_1.ParseError.URIExpected, [cssScanner_1.TokenType.SemiColon]); | ||
if (!node.addChild(this._parseURILiteral())) { | ||
node.addChild(this._parseIdent()); // optional prefix | ||
if (!node.addChild(this._parseURILiteral()) && !node.addChild(this._parseStringLiteral())) { | ||
return this.finish(node, cssErrors_1.ParseError.URIExpected, [cssScanner_1.TokenType.SemiColon]); | ||
} | ||
} | ||
@@ -598,8 +615,10 @@ if (!this.accept(cssScanner_1.TokenType.SemiColon)) { | ||
}; | ||
Parser.prototype._parseMediaDeclaration = function () { | ||
return this._tryParseRuleset(false) | ||
Parser.prototype._parseMediaDeclaration = function (isNested) { | ||
if (isNested === void 0) { isNested = false; } | ||
return this._tryParseRuleset(isNested) | ||
|| this._tryToParseDeclaration() | ||
|| this._parseStylesheetStatement(); | ||
}; | ||
Parser.prototype._parseMedia = function () { | ||
Parser.prototype._parseMedia = function (isNested) { | ||
if (isNested === void 0) { isNested = false; } | ||
// MEDIA_SYM S* media_query_list '{' S* ruleset* '}' S* | ||
@@ -619,3 +638,3 @@ // media_query_list : S* [media_query [ ',' S* media_query ]* ]? | ||
} | ||
return this._parseBody(node, this._parseMediaDeclaration.bind(this)); | ||
return this._parseBody(node, this._parseMediaDeclaration.bind(this, isNested)); | ||
}; | ||
@@ -631,2 +650,3 @@ Parser.prototype._parseMediaQuery = function (resyncStopToken) { | ||
if (this.accept(cssScanner_1.TokenType.Ident, 'only', true) || this.accept(cssScanner_1.TokenType.Ident, 'not', true)) { | ||
// optional | ||
} | ||
@@ -771,2 +791,10 @@ if (!node.addChild(this._parseIdent())) { | ||
if (this.accept(cssScanner_1.TokenType.Delim, '>')) { | ||
var mark = this.mark(); | ||
if (!this.hasWhitespace() && this.accept(cssScanner_1.TokenType.Delim, '>')) { | ||
if (!this.hasWhitespace() && this.accept(cssScanner_1.TokenType.Delim, '>')) { | ||
node.type = nodes.NodeType.SelectorCombinatorShadowPiercingDescendant; | ||
return this.finish(node); | ||
} | ||
this.restoreAtMark(mark); | ||
} | ||
node.type = nodes.NodeType.SelectorCombinatorParent; | ||
@@ -783,2 +811,10 @@ return this.finish(node); | ||
} | ||
else if (this.accept(cssScanner_1.TokenType.Delim, '/')) { | ||
var mark = this.mark(); | ||
if (!this.hasWhitespace() && this.accept(cssScanner_1.TokenType.Ident, 'deep') && !this.hasWhitespace() && this.accept(cssScanner_1.TokenType.Delim, '/')) { | ||
node.type = nodes.NodeType.SelectorCombinatorShadowPiercingDescendant; | ||
return this.finish(node); | ||
} | ||
this.restoreAtMark(mark); | ||
} | ||
else { | ||
@@ -850,2 +886,3 @@ return null; | ||
if (!node.addChild(this._parseBinaryExpr())) { | ||
// is this bad? | ||
} | ||
@@ -935,5 +972,5 @@ if (!this.accept(cssScanner_1.TokenType.BracketR)) { | ||
node.setOperator(this._parseUnaryOperator()); // optional | ||
if (node.setExpression(this._parseFunction()) || | ||
if (node.setExpression(this._parseURILiteral()) || | ||
node.setExpression(this._parseFunction()) || | ||
node.setExpression(this._parseIdent()) || | ||
node.setExpression(this._parseURILiteral()) || | ||
node.setExpression(this._parseStringLiteral()) || | ||
@@ -982,8 +1019,26 @@ node.setExpression(this._parseNumeric()) || | ||
Parser.prototype._parseURILiteral = function () { | ||
if (!this.peekRegExp(cssScanner_1.TokenType.Ident, /url(-prefix)?/i)) { | ||
return null; | ||
} | ||
var pos = this.mark(); | ||
var node = this.createNode(nodes.NodeType.URILiteral); | ||
if (this.accept(cssScanner_1.TokenType.URI) || this.accept(cssScanner_1.TokenType.BadUri)) { | ||
return this.finish(node); | ||
this.accept(cssScanner_1.TokenType.Ident); | ||
if (this.hasWhitespace() || !this.accept(cssScanner_1.TokenType.ParenthesisL)) { | ||
this.restoreAtMark(pos); | ||
return null; | ||
} | ||
return null; | ||
node.addChild(this._parseURLArgument()); // argument is optional | ||
if (!this.accept(cssScanner_1.TokenType.ParenthesisR)) { | ||
return this.finish(node, cssErrors_1.ParseError.RightParenthesisExpected); | ||
} | ||
return this.finish(node); | ||
}; | ||
Parser.prototype._parseURLArgument = function () { | ||
var node = this.create(nodes.Node); | ||
if (!this.accept(cssScanner_1.TokenType.String) && !this.accept(cssScanner_1.TokenType.BadString) && !this.acceptUnquotedString()) { | ||
return null; | ||
} | ||
; | ||
return this.finish(node); | ||
}; | ||
Parser.prototype._parseIdent = function (referenceTypes) { | ||
@@ -1029,2 +1084,3 @@ var node = this.create(nodes.Identifier); | ||
while (this.accept(cssScanner_1.TokenType.Ident) && this.accept(cssScanner_1.TokenType.Delim, '.')) { | ||
// loop | ||
} | ||
@@ -1031,0 +1087,0 @@ } |
@@ -15,2 +15,3 @@ (function (factory) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var TokenType; | ||
@@ -22,3 +23,3 @@ (function (TokenType) { | ||
TokenType[TokenType["BadString"] = 3] = "BadString"; | ||
TokenType[TokenType["BadUri"] = 4] = "BadUri"; | ||
TokenType[TokenType["UnquotedString"] = 4] = "UnquotedString"; | ||
TokenType[TokenType["Hash"] = 5] = "Hash"; | ||
@@ -28,37 +29,36 @@ TokenType[TokenType["Num"] = 6] = "Num"; | ||
TokenType[TokenType["Dimension"] = 8] = "Dimension"; | ||
TokenType[TokenType["URI"] = 9] = "URI"; | ||
TokenType[TokenType["UnicodeRange"] = 10] = "UnicodeRange"; | ||
TokenType[TokenType["CDO"] = 11] = "CDO"; | ||
TokenType[TokenType["CDC"] = 12] = "CDC"; | ||
TokenType[TokenType["Colon"] = 13] = "Colon"; | ||
TokenType[TokenType["SemiColon"] = 14] = "SemiColon"; | ||
TokenType[TokenType["CurlyL"] = 15] = "CurlyL"; | ||
TokenType[TokenType["CurlyR"] = 16] = "CurlyR"; | ||
TokenType[TokenType["ParenthesisL"] = 17] = "ParenthesisL"; | ||
TokenType[TokenType["ParenthesisR"] = 18] = "ParenthesisR"; | ||
TokenType[TokenType["BracketL"] = 19] = "BracketL"; | ||
TokenType[TokenType["BracketR"] = 20] = "BracketR"; | ||
TokenType[TokenType["Whitespace"] = 21] = "Whitespace"; | ||
TokenType[TokenType["Includes"] = 22] = "Includes"; | ||
TokenType[TokenType["Dashmatch"] = 23] = "Dashmatch"; | ||
TokenType[TokenType["SubstringOperator"] = 24] = "SubstringOperator"; | ||
TokenType[TokenType["PrefixOperator"] = 25] = "PrefixOperator"; | ||
TokenType[TokenType["SuffixOperator"] = 26] = "SuffixOperator"; | ||
TokenType[TokenType["Delim"] = 27] = "Delim"; | ||
TokenType[TokenType["EMS"] = 28] = "EMS"; | ||
TokenType[TokenType["EXS"] = 29] = "EXS"; | ||
TokenType[TokenType["Length"] = 30] = "Length"; | ||
TokenType[TokenType["Angle"] = 31] = "Angle"; | ||
TokenType[TokenType["Time"] = 32] = "Time"; | ||
TokenType[TokenType["Freq"] = 33] = "Freq"; | ||
TokenType[TokenType["Exclamation"] = 34] = "Exclamation"; | ||
TokenType[TokenType["Resolution"] = 35] = "Resolution"; | ||
TokenType[TokenType["Comma"] = 36] = "Comma"; | ||
TokenType[TokenType["Charset"] = 37] = "Charset"; | ||
TokenType[TokenType["EscapedJavaScript"] = 38] = "EscapedJavaScript"; | ||
TokenType[TokenType["BadEscapedJavaScript"] = 39] = "BadEscapedJavaScript"; | ||
TokenType[TokenType["Comment"] = 40] = "Comment"; | ||
TokenType[TokenType["SingleLineComment"] = 41] = "SingleLineComment"; | ||
TokenType[TokenType["EOF"] = 42] = "EOF"; | ||
TokenType[TokenType["CustomToken"] = 43] = "CustomToken"; | ||
TokenType[TokenType["UnicodeRange"] = 9] = "UnicodeRange"; | ||
TokenType[TokenType["CDO"] = 10] = "CDO"; | ||
TokenType[TokenType["CDC"] = 11] = "CDC"; | ||
TokenType[TokenType["Colon"] = 12] = "Colon"; | ||
TokenType[TokenType["SemiColon"] = 13] = "SemiColon"; | ||
TokenType[TokenType["CurlyL"] = 14] = "CurlyL"; | ||
TokenType[TokenType["CurlyR"] = 15] = "CurlyR"; | ||
TokenType[TokenType["ParenthesisL"] = 16] = "ParenthesisL"; | ||
TokenType[TokenType["ParenthesisR"] = 17] = "ParenthesisR"; | ||
TokenType[TokenType["BracketL"] = 18] = "BracketL"; | ||
TokenType[TokenType["BracketR"] = 19] = "BracketR"; | ||
TokenType[TokenType["Whitespace"] = 20] = "Whitespace"; | ||
TokenType[TokenType["Includes"] = 21] = "Includes"; | ||
TokenType[TokenType["Dashmatch"] = 22] = "Dashmatch"; | ||
TokenType[TokenType["SubstringOperator"] = 23] = "SubstringOperator"; | ||
TokenType[TokenType["PrefixOperator"] = 24] = "PrefixOperator"; | ||
TokenType[TokenType["SuffixOperator"] = 25] = "SuffixOperator"; | ||
TokenType[TokenType["Delim"] = 26] = "Delim"; | ||
TokenType[TokenType["EMS"] = 27] = "EMS"; | ||
TokenType[TokenType["EXS"] = 28] = "EXS"; | ||
TokenType[TokenType["Length"] = 29] = "Length"; | ||
TokenType[TokenType["Angle"] = 30] = "Angle"; | ||
TokenType[TokenType["Time"] = 31] = "Time"; | ||
TokenType[TokenType["Freq"] = 32] = "Freq"; | ||
TokenType[TokenType["Exclamation"] = 33] = "Exclamation"; | ||
TokenType[TokenType["Resolution"] = 34] = "Resolution"; | ||
TokenType[TokenType["Comma"] = 35] = "Comma"; | ||
TokenType[TokenType["Charset"] = 36] = "Charset"; | ||
TokenType[TokenType["EscapedJavaScript"] = 37] = "EscapedJavaScript"; | ||
TokenType[TokenType["BadEscapedJavaScript"] = 38] = "BadEscapedJavaScript"; | ||
TokenType[TokenType["Comment"] = 39] = "Comment"; | ||
TokenType[TokenType["SingleLineComment"] = 40] = "SingleLineComment"; | ||
TokenType[TokenType["EOF"] = 41] = "EOF"; | ||
TokenType[TokenType["CustomToken"] = 42] = "CustomToken"; | ||
})(TokenType = exports.TokenType || (exports.TokenType = {})); | ||
@@ -132,20 +132,7 @@ var MultiLineStream = (function () { | ||
var _a = 'a'.charCodeAt(0); | ||
var _e = 'e'.charCodeAt(0); | ||
var _f = 'f'.charCodeAt(0); | ||
var _i = 'i'.charCodeAt(0); | ||
var _l = 'l'.charCodeAt(0); | ||
var _p = 'p'.charCodeAt(0); | ||
var _r = 'r'.charCodeAt(0); | ||
var _u = 'u'.charCodeAt(0); | ||
var _x = 'x'.charCodeAt(0); | ||
; | ||
var _z = 'z'.charCodeAt(0); | ||
var _A = 'A'.charCodeAt(0); | ||
var _E = 'E'.charCodeAt(0); | ||
var _F = 'F'.charCodeAt(0); | ||
var _I = 'I'.charCodeAt(0); | ||
var _L = 'L'.charCodeAt(0); | ||
var _P = 'P'.charCodeAt(0); | ||
var _R = 'R'.charCodeAt(0); | ||
var _U = 'U'.charCodeAt(0); | ||
var _X = 'X'.charCodeAt(0); | ||
var _Z = 'Z'.charCodeAt(0); | ||
@@ -187,4 +174,2 @@ var _0 = '0'.charCodeAt(0); | ||
var _BNG = '!'.charCodeAt(0); | ||
var _url = [_u, _U, _r, _R, _l, _L, _LPA, _LPA]; | ||
var _url_prefix = [_u, _U, _r, _R, _l, _L, _MIN, _MIN, _p, _P, _r, _R, _e, _E, _f, _F, _i, _I, _x, _X, _LPA, _LPA]; | ||
var staticTokenTable = {}; | ||
@@ -244,2 +229,10 @@ staticTokenTable[_SEM] = TokenType.SemiColon; | ||
}; | ||
Scanner.prototype.scanUnquotedString = function () { | ||
var offset = this.stream.pos(); | ||
var content = []; | ||
if (this._unquotedString(content)) { | ||
return this.finishToken(offset, TokenType.UnquotedString, content.join('')); | ||
} | ||
return null; | ||
}; | ||
Scanner.prototype.scan = function () { | ||
@@ -256,2 +249,5 @@ // processes all whitespaces and comments | ||
} | ||
return this.scanNext(offset); | ||
}; | ||
Scanner.prototype.scanNext = function (offset) { | ||
// CDO <!-- | ||
@@ -265,7 +261,2 @@ if (this.stream.advanceIfChars([_LAN, _BNG, _MIN, _MIN])) { | ||
} | ||
// URL | ||
var tokenType = this._url(); | ||
if (tokenType !== null) { | ||
return this.finishToken(offset, tokenType); | ||
} | ||
var content = []; | ||
@@ -313,6 +304,6 @@ if (this.ident(content)) { | ||
var dim = this.stream.substring(pos).toLowerCase(); | ||
tokenType = staticUnitTable[dim]; | ||
if (typeof tokenType !== 'undefined') { | ||
var tokenType_1 = staticUnitTable[dim]; | ||
if (typeof tokenType_1 !== 'undefined') { | ||
// Known dimension 43px | ||
return this.finishToken(offset, tokenType, content.join('')); | ||
return this.finishToken(offset, tokenType_1, content.join('')); | ||
} | ||
@@ -328,3 +319,3 @@ else { | ||
content = []; | ||
tokenType = this._string(content); | ||
var tokenType = this._string(content); | ||
if (tokenType !== null) { | ||
@@ -470,2 +461,3 @@ return this.finishToken(offset, tokenType, content.join('')); | ||
catch (e) { | ||
// ignore | ||
} | ||
@@ -508,2 +500,3 @@ // optional whitespace or new line, not part of result text | ||
while (this._stringChar(closeQuote, result) || this._escape(result, true)) { | ||
// loop | ||
} | ||
@@ -521,35 +514,20 @@ if (this.stream.peekChar() === closeQuote) { | ||
}; | ||
Scanner.prototype._url = function () { | ||
if (this._matchWordAnyCase(_url) || this._matchWordAnyCase(_url_prefix)) { | ||
this._whitespace(); | ||
var tokenType = TokenType.URI, stringType = this._string([]); | ||
if (stringType === TokenType.BadString) { | ||
tokenType = TokenType.BadUri; | ||
} | ||
else if (stringType === null) { | ||
var nestedBrackets_1 = 0; | ||
this.stream.advanceWhileChar(function (ch) { | ||
if (ch === _LPA) { | ||
nestedBrackets_1++; | ||
} | ||
else if (ch === _RPA) { | ||
if (nestedBrackets_1 === 0) { | ||
return false; | ||
} | ||
nestedBrackets_1--; | ||
} | ||
return true; | ||
}); | ||
tokenType = TokenType.URI; | ||
} | ||
this._whitespace(); | ||
if (this.stream.advanceIfChar(_RPA)) { | ||
return tokenType; | ||
} | ||
else { | ||
return TokenType.BadUri; | ||
} | ||
Scanner.prototype._unquotedChar = function (result) { | ||
// not closeQuote, not backslash, not newline | ||
var ch = this.stream.peekChar(); | ||
if (ch !== 0 && ch !== _SQO && ch !== _DQO && ch != _LPA && ch != _RPA && ch != _WSP && ch != _TAB && ch != _NWL && ch != _LFD && ch != _CAR) { | ||
this.stream.advance(1); | ||
result.push(String.fromCharCode(ch)); | ||
return true; | ||
} | ||
return null; | ||
return false; | ||
}; | ||
; | ||
Scanner.prototype._unquotedString = function (result) { | ||
var hasContent = false; | ||
while (this._unquotedChar(result) || this._escape(result)) { | ||
hasContent = true; | ||
} | ||
return hasContent; | ||
}; | ||
Scanner.prototype._whitespace = function () { | ||
@@ -572,7 +550,6 @@ var n = this.stream.advanceWhileChar(function (ch) { | ||
if (hasMinus && this._minus(result) /* -- */) { | ||
var hasContent = false; | ||
while (this._identChar(result) || this._escape(result)) { | ||
hasContent = true; | ||
} | ||
if (hasContent) { | ||
if (this._identFirstChar(result) || this._escape(result)) { | ||
while (this._identChar(result) || this._escape(result)) { | ||
// loop | ||
} | ||
return true; | ||
@@ -583,2 +560,3 @@ } | ||
while (this._identChar(result) || this._escape(result)) { | ||
// loop | ||
} | ||
@@ -585,0 +563,0 @@ return true; |
@@ -1,6 +0,11 @@ | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
(function (factory) { | ||
@@ -20,2 +25,3 @@ if (typeof module === "object" && typeof module.exports === "object") { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var nodes = require("./cssNodes"); | ||
@@ -22,0 +28,0 @@ var arrays_1 = require("../utils/arrays"); |
@@ -1,6 +0,11 @@ | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
(function (factory) { | ||
@@ -20,2 +25,3 @@ if (typeof module === "object" && typeof module.exports === "object") { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var lessScanner = require("./lessScanner"); | ||
@@ -60,3 +66,3 @@ var cssScanner_1 = require("./cssScanner"); | ||
} | ||
if (!this.accept(cssScanner_1.TokenType.URI) && !this.accept(cssScanner_1.TokenType.String)) { | ||
if (!node.addChild(this._parseURILiteral()) && !node.addChild(this._parseStringLiteral())) { | ||
return this.finish(node, cssErrors_1.ParseError.URIOrStringExpected, [cssScanner_1.TokenType.SemiColon]); | ||
@@ -78,4 +84,5 @@ } | ||
}; | ||
LESSParser.prototype._parseMediaDeclaration = function () { | ||
return this._tryParseRuleset(false) | ||
LESSParser.prototype._parseMediaDeclaration = function (isNested) { | ||
if (isNested === void 0) { isNested = false; } | ||
return this._tryParseRuleset(isNested) | ||
|| this._tryToParseDeclaration() | ||
@@ -184,3 +191,3 @@ || this._tryParseMixinDeclaration() | ||
return this._parseKeyframe() | ||
|| this._parseMedia() | ||
|| this._parseMedia(true) | ||
|| this._parseImport() | ||
@@ -213,2 +220,3 @@ || this._parseDetachedRuleSetMixin() // less detached ruleset mixin | ||
while (!this.hasWhitespace() && (this.accept(cssScanner_1.TokenType.Delim, '-') || node.addChild(this._parseIdent()) || this.accept(cssScanner_1.TokenType.Delim, '&'))) { | ||
// support &-foo | ||
} | ||
@@ -463,2 +471,3 @@ return this.finish(node); | ||
if (!node.addChild(this._parseExpr())) { | ||
// empty (?) | ||
} | ||
@@ -492,2 +501,13 @@ if (!this.accept(cssScanner_1.TokenType.ParenthesisR)) { | ||
}; | ||
LESSParser.prototype._parseURLArgument = function () { | ||
var pos = this.mark(); | ||
var node = _super.prototype._parseURLArgument.call(this); | ||
if (!node || !this.peek(cssScanner_1.TokenType.ParenthesisR)) { | ||
this.restoreAtMark(pos); | ||
var node_2 = this.create(nodes.Node); | ||
node_2.addChild(this._parseBinaryExpr()); | ||
return this.finish(node_2); | ||
} | ||
return node; | ||
}; | ||
return LESSParser; | ||
@@ -494,0 +514,0 @@ }(cssParser.Parser)); |
@@ -1,6 +0,11 @@ | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
(function (factory) { | ||
@@ -20,2 +25,3 @@ if (typeof module === "object" && typeof module.exports === "object") { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var scanner = require("./cssScanner"); | ||
@@ -35,8 +41,3 @@ var _FSL = '/'.charCodeAt(0); | ||
} | ||
LESSScanner.prototype.scan = function () { | ||
var triviaToken = this.trivia(); | ||
if (triviaToken !== null) { | ||
return triviaToken; | ||
} | ||
var offset = this.stream.pos(); | ||
LESSScanner.prototype.scanNext = function (offset) { | ||
// LESS: escaped JavaScript code `let a = "dddd"` | ||
@@ -50,3 +51,3 @@ var tokenType = this.escapedJavaScript(); | ||
} | ||
return _super.prototype.scan.call(this); | ||
return _super.prototype.scanNext.call(this, offset); | ||
}; | ||
@@ -53,0 +54,0 @@ LESSScanner.prototype.comment = function () { |
@@ -15,2 +15,3 @@ (function (factory) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var nls = require("vscode-nls"); | ||
@@ -17,0 +18,0 @@ var localize = nls.loadMessageBundle(); |
@@ -1,6 +0,11 @@ | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
(function (factory) { | ||
@@ -20,2 +25,3 @@ if (typeof module === "object" && typeof module.exports === "object") { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var scssScanner = require("./scssScanner"); | ||
@@ -51,7 +57,7 @@ var cssScanner_1 = require("./cssScanner"); | ||
} | ||
if (!this.accept(cssScanner_1.TokenType.URI) && !this.accept(cssScanner_1.TokenType.String)) { | ||
if (!node.addChild(this._parseURILiteral()) && !node.addChild(this._parseStringLiteral())) { | ||
return this.finish(node, cssErrors_1.ParseError.URIOrStringExpected); | ||
} | ||
while (this.accept(cssScanner_1.TokenType.Comma)) { | ||
if (!this.accept(cssScanner_1.TokenType.URI) && !this.accept(cssScanner_1.TokenType.String)) { | ||
if (!node.addChild(this._parseURILiteral()) && !node.addChild(this._parseStringLiteral())) { | ||
return this.finish(node, cssErrors_1.ParseError.URIOrStringExpected); | ||
@@ -77,4 +83,4 @@ } | ||
} | ||
if (this.accept(cssScanner_1.TokenType.Exclamation)) { | ||
if (!this.accept(cssScanner_1.TokenType.Ident, 'default', true)) { | ||
while (this.accept(cssScanner_1.TokenType.Exclamation)) { | ||
if (!this.acceptOne(cssScanner_1.TokenType.Ident, ['default', 'global'], false)) { | ||
return this.finish(node, cssErrors_1.ParseError.UnknownKeyword); | ||
@@ -108,2 +114,3 @@ } | ||
if (!this.hasWhitespace() && this.accept(cssScanner_1.TokenType.Delim, '-')) { | ||
// '-' is a valid char inside a ident (special treatment here to support #{foo}-#{bar}) | ||
} | ||
@@ -165,5 +172,5 @@ if (this.hasWhitespace()) { | ||
|| this._parseImport() // nested @import | ||
|| this._parseMedia() // nested @media | ||
|| this._parseMedia(true) // nested @media | ||
|| this._parseFontFace() // nested @font-face | ||
|| this._parseWarnAndDebug() // @warn and @debug statements | ||
|| this._parseWarnAndDebug() // @warn, @debug and @error statements | ||
|| this._parseControlStatement() // @if, @while, @for, @each | ||
@@ -234,2 +241,3 @@ || this._parseFunctionDeclaration() // @function | ||
while (!this.hasWhitespace() && (this.accept(cssScanner_1.TokenType.Delim, '-') || node.addChild(this._parseIdent()) || this.accept(cssScanner_1.TokenType.Delim, '&'))) { | ||
// support &-foo | ||
} | ||
@@ -252,7 +260,9 @@ return this.finish(node); | ||
SCSSParser.prototype._parseWarnAndDebug = function () { | ||
if (!this.peek(cssScanner_1.TokenType.AtKeyword, '@debug') && !this.peek(cssScanner_1.TokenType.AtKeyword, '@warn')) { | ||
if (!this.peek(cssScanner_1.TokenType.AtKeyword, '@debug') | ||
&& !this.peek(cssScanner_1.TokenType.AtKeyword, '@warn') | ||
&& !this.peek(cssScanner_1.TokenType.AtKeyword, '@error')) { | ||
return null; | ||
} | ||
var node = this.createNode(nodes.NodeType.Debug); | ||
this.consumeToken(); // @debug or @warn | ||
this.consumeToken(); // @debug, @warn or @error | ||
node.addChild(this._parseExpr()); // optional | ||
@@ -420,2 +430,3 @@ return this.finish(node); | ||
if (this.accept(scssScanner.Ellipsis)) { | ||
// ok | ||
} | ||
@@ -493,2 +504,13 @@ if (this.accept(cssScanner_1.TokenType.Colon)) { | ||
}; | ||
SCSSParser.prototype._parseURLArgument = function () { | ||
var pos = this.mark(); | ||
var node = _super.prototype._parseURLArgument.call(this); | ||
if (!node || !this.peek(cssScanner_1.TokenType.ParenthesisR)) { | ||
this.restoreAtMark(pos); | ||
var node_1 = this.create(nodes.Node); | ||
node_1.addChild(this._parseBinaryExpr()); | ||
return this.finish(node_1); | ||
} | ||
return node; | ||
}; | ||
SCSSParser.prototype._parseOperation = function () { | ||
@@ -495,0 +517,0 @@ var node = this.create(nodes.Node); |
@@ -1,6 +0,11 @@ | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
(function (factory) { | ||
@@ -20,2 +25,3 @@ if (typeof module === "object" && typeof module.exports === "object") { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var cssScanner_1 = require("./cssScanner"); | ||
@@ -48,9 +54,3 @@ var _FSL = '/'.charCodeAt(0); | ||
} | ||
SCSSScanner.prototype.scan = function () { | ||
// processes all whitespaces and comments | ||
var triviaToken = this.trivia(); | ||
if (triviaToken !== null) { | ||
return triviaToken; | ||
} | ||
var offset = this.stream.pos(); | ||
SCSSScanner.prototype.scanNext = function (offset) { | ||
// scss variable | ||
@@ -96,3 +96,3 @@ if (this.stream.advanceIfChar(_DLR)) { | ||
} | ||
return _super.prototype.scan.call(this); | ||
return _super.prototype.scanNext.call(this, offset); | ||
}; | ||
@@ -99,0 +99,0 @@ SCSSScanner.prototype.comment = function () { |
@@ -15,2 +15,3 @@ (function (factory) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var nodes = require("../parser/cssNodes"); | ||
@@ -17,0 +18,0 @@ var languageFacts = require("./languageFacts"); |
@@ -15,2 +15,3 @@ (function (factory) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var nodes = require("../parser/cssNodes"); | ||
@@ -17,0 +18,0 @@ var cssSymbolScope_1 = require("../parser/cssSymbolScope"); |
@@ -15,2 +15,3 @@ (function (factory) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var nodes = require("../parser/cssNodes"); | ||
@@ -17,0 +18,0 @@ var languageFacts = require("./languageFacts"); |
@@ -15,2 +15,3 @@ (function (factory) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var nodes = require("../parser/cssNodes"); | ||
@@ -142,4 +143,5 @@ var vscode_languageserver_types_1 = require("vscode-languageserver-types"); | ||
return { | ||
changes: [{ textDocument: { version: document.version, uri: document.uri }, edits: edits }] | ||
changes: (_a = {}, _a[document.uri] = edits, _a) | ||
}; | ||
var _a; | ||
}; | ||
@@ -146,0 +148,0 @@ return CSSNavigation; |
@@ -15,2 +15,3 @@ (function (factory) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var nodes = require("../parser/cssNodes"); | ||
@@ -17,0 +18,0 @@ var vscode_languageserver_types_1 = require("vscode-languageserver-types"); |
@@ -15,2 +15,3 @@ (function (factory) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var nodes = require("../parser/cssNodes"); | ||
@@ -17,0 +18,0 @@ var browsers = require("../data/browsers"); |
@@ -1,6 +0,11 @@ | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
(function (factory) { | ||
@@ -20,2 +25,3 @@ if (typeof module === "object" && typeof module.exports === "object") { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var cssCompletion_1 = require("./cssCompletion"); | ||
@@ -22,0 +28,0 @@ var vscode_languageserver_types_1 = require("vscode-languageserver-types"); |
@@ -15,2 +15,3 @@ (function (factory) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var languageFacts = require("./languageFacts"); | ||
@@ -17,0 +18,0 @@ var lintRules_1 = require("./lintRules"); |
@@ -15,2 +15,3 @@ (function (factory) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var nodes = require("../parser/cssNodes"); | ||
@@ -17,0 +18,0 @@ var nls = require("vscode-nls"); |
@@ -1,6 +0,11 @@ | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
(function (factory) { | ||
@@ -20,2 +25,3 @@ if (typeof module === "object" && typeof module.exports === "object") { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var cssCompletion_1 = require("./cssCompletion"); | ||
@@ -22,0 +28,0 @@ var vscode_languageserver_types_1 = require("vscode-languageserver-types"); |
@@ -1,6 +0,11 @@ | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
(function (factory) { | ||
@@ -20,2 +25,3 @@ if (typeof module === "object" && typeof module.exports === "object") { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var nodes = require("../parser/cssNodes"); | ||
@@ -160,3 +166,3 @@ var Element = (function () { | ||
MarkedStringPrinter.prototype.writeLine = function (level, content) { | ||
var indent = new Array(level).join(' '); | ||
var indent = new Array(level + 1).join(' '); | ||
this.result.push(indent + content); | ||
@@ -352,2 +358,3 @@ }; | ||
selectorChild.type === nodes.NodeType.SelectorCombinatorParent || | ||
selectorChild.type === nodes.NodeType.SelectorCombinatorShadowPiercingDescendant || | ||
selectorChild.type === nodes.NodeType.SelectorCombinatorSibling || | ||
@@ -354,0 +361,0 @@ selectorChild.type === nodes.NodeType.SelectorCombinatorAllSiblings) { |
@@ -15,2 +15,3 @@ (function (factory) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
@@ -17,0 +18,0 @@ * Takes a sorted array and a function p. The array is sorted in such a way that all elements where p(x) is false |
@@ -15,2 +15,3 @@ (function (factory) { | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function startsWith(haystack, needle) { | ||
@@ -17,0 +18,0 @@ if (haystack.length < needle.length) { |
{ | ||
"name": "vscode-css-languageservice", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Language service for CSS, LESS and SCSS", | ||
@@ -17,9 +17,10 @@ "main": "./lib/cssLanguageService.js", | ||
"devDependencies": { | ||
"@types/mocha": "^2.2.32", | ||
"@types/node": "^6.0.46", | ||
"cpy-cli": "^1.0.1", | ||
"istanbul": "^0.4.5", | ||
"mkdirp": "^0.5.1", | ||
"mocha": "^2.4.5", | ||
"typescript": "^2.1.5", | ||
"xml2js": "^0.4.16", | ||
"mkdirp": "^0.5.1", | ||
"cpy-cli": "^1.0.1", | ||
"@types/node": "^6.0.46", | ||
"@types/mocha": "^2.2.32" | ||
"xml2js": "^0.4.16" | ||
}, | ||
@@ -36,2 +37,3 @@ "dependencies": { | ||
"test": "npm run compile && mocha", | ||
"coverage": "node ./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha -- --ui tdd -R spec -t 5000", | ||
"update-data": "node ./build/generate_browserjs.js", | ||
@@ -38,0 +40,0 @@ "install-types-next": "npm install vscode-languageserver-types@next -f -S" |
3624099
71
20233
8