vscode-html-languageservice
Advanced tools
Comparing version 5.0.6 to 5.0.7
// copied from js-beautify/js/lib/beautify-css.js | ||
// version: 1.14.7 | ||
// version: 1.14.9 | ||
/* AUTO-GENERATED. DO NOT MODIFY. */ | ||
@@ -1079,14 +1079,14 @@ /* | ||
this.NESTED_AT_RULE = { | ||
"@page": true, | ||
"@font-face": true, | ||
"@keyframes": true, | ||
"page": true, | ||
"font-face": true, | ||
"keyframes": true, | ||
// also in CONDITIONAL_GROUP_RULE below | ||
"@media": true, | ||
"@supports": true, | ||
"@document": true | ||
"media": true, | ||
"supports": true, | ||
"document": true | ||
}; | ||
this.CONDITIONAL_GROUP_RULE = { | ||
"@media": true, | ||
"@supports": true, | ||
"@document": true | ||
"media": true, | ||
"supports": true, | ||
"document": true | ||
}; | ||
@@ -1219,4 +1219,3 @@ this.NON_SEMICOLON_NEWLINE_PROPERTY = [ | ||
var enteringConditionalGroup = false; | ||
var insideAtExtend = false; | ||
var insideAtImport = false; | ||
var insideNonNestedAtRule = false; | ||
var insideScssMap = false; | ||
@@ -1276,6 +1275,28 @@ var topCharacter = this._ch; | ||
this.eatWhitespace(true); | ||
} else if (this._ch === '@' || this._ch === '$') { | ||
} else if (this._ch === '$') { | ||
this.preserveSingleSpace(isAfterSpace); | ||
// deal with less propery mixins @{...} | ||
this.print_string(this._ch); | ||
// strip trailing space, if present, for hash property checks | ||
var variable = this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g); | ||
if (variable.match(/[ :]$/)) { | ||
// we have a variable or pseudo-class, add it and insert one space before continuing | ||
variable = this.eatString(": ").replace(/\s$/, ''); | ||
this.print_string(variable); | ||
this._output.space_before_token = true; | ||
} | ||
variable = variable.replace(/\s$/, ''); | ||
// might be sass variable | ||
if (parenLevel === 0 && variable.indexOf(':') !== -1) { | ||
insidePropertyValue = true; | ||
this.indent(); | ||
} | ||
} else if (this._ch === '@') { | ||
this.preserveSingleSpace(isAfterSpace); | ||
// deal with less property mixins @{...} | ||
if (this._input.peek() === '{') { | ||
@@ -1298,10 +1319,9 @@ this.print_string(this._ch + this.eatString('}')); | ||
if (variableOrRule === 'extend') { | ||
insideAtExtend = true; | ||
} else if (variableOrRule === 'import') { | ||
insideAtImport = true; | ||
} | ||
// might be less variable | ||
if (parenLevel === 0 && variableOrRule.indexOf(':') !== -1) { | ||
insidePropertyValue = true; | ||
this.indent(); | ||
// might be a nesting at-rule | ||
if (variableOrRule in this.NESTED_AT_RULE) { | ||
// might be a nesting at-rule | ||
} else if (variableOrRule in this.NESTED_AT_RULE) { | ||
this._nestedLevel += 1; | ||
@@ -1311,6 +1331,6 @@ if (variableOrRule in this.CONDITIONAL_GROUP_RULE) { | ||
} | ||
// might be less variable | ||
} else if (!insideRule && parenLevel === 0 && variableOrRule.indexOf(':') !== -1) { | ||
insidePropertyValue = true; | ||
this.indent(); | ||
// might be a non-nested at-rule | ||
} else if (parenLevel === 0 && !insidePropertyValue) { | ||
insideNonNestedAtRule = true; | ||
} | ||
@@ -1327,2 +1347,5 @@ } | ||
// non nested at rule becomes nested | ||
insideNonNestedAtRule = false; | ||
// when entering conditional groups, only rulesets are allowed | ||
@@ -1368,4 +1391,3 @@ if (enteringConditionalGroup) { | ||
} | ||
insideAtImport = false; | ||
insideAtExtend = false; | ||
if (insidePropertyValue) { | ||
@@ -1404,5 +1426,6 @@ this.outdent(); | ||
if ((insideRule || enteringConditionalGroup) && !(this._input.lookBack("&") || this.foundNestedPseudoClass()) && !this._input.lookBack("(") && !insideAtExtend && parenLevel === 0) { | ||
if ((insideRule || enteringConditionalGroup) && !(this._input.lookBack("&") || this.foundNestedPseudoClass()) && !this._input.lookBack("(") && !insideNonNestedAtRule && parenLevel === 0) { | ||
// 'property: value' delimiter | ||
// which could be in a conditional group query | ||
this.print_string(':'); | ||
@@ -1444,4 +1467,3 @@ if (!insidePropertyValue) { | ||
} | ||
insideAtExtend = false; | ||
insideAtImport = false; | ||
insideNonNestedAtRule = false; | ||
this.print_string(this._ch); | ||
@@ -1511,3 +1533,3 @@ this.eatWhitespace(true); | ||
this.eatWhitespace(true); | ||
if (this._options.selector_separator_newline && (!insidePropertyValue || insideScssMap) && parenLevel === 0 && !insideAtImport && !insideAtExtend) { | ||
if (this._options.selector_separator_newline && (!insidePropertyValue || insideScssMap) && parenLevel === 0 && !insideNonNestedAtRule) { | ||
this._output.add_new_line(); | ||
@@ -1514,0 +1536,0 @@ } else { |
@@ -256,3 +256,3 @@ /*--------------------------------------------------------------------------------------------- | ||
if (s.length <= 1) { | ||
return s.replace(/['"]/, ''); | ||
return s.replace(/['"]/, ''); // CodeQL [SM02383] False positive: The string length is at most one, so we don't need the global flag. | ||
} | ||
@@ -259,0 +259,0 @@ if (s[0] === `'` || s[0] === `"`) { |
// copied from js-beautify/js/lib/beautify-css.js | ||
// version: 1.14.7 | ||
// version: 1.14.9 | ||
/* AUTO-GENERATED. DO NOT MODIFY. */ | ||
@@ -1082,14 +1082,14 @@ /* | ||
this.NESTED_AT_RULE = { | ||
"@page": true, | ||
"@font-face": true, | ||
"@keyframes": true, | ||
"page": true, | ||
"font-face": true, | ||
"keyframes": true, | ||
// also in CONDITIONAL_GROUP_RULE below | ||
"@media": true, | ||
"@supports": true, | ||
"@document": true | ||
"media": true, | ||
"supports": true, | ||
"document": true | ||
}; | ||
this.CONDITIONAL_GROUP_RULE = { | ||
"@media": true, | ||
"@supports": true, | ||
"@document": true | ||
"media": true, | ||
"supports": true, | ||
"document": true | ||
}; | ||
@@ -1222,4 +1222,3 @@ this.NON_SEMICOLON_NEWLINE_PROPERTY = [ | ||
var enteringConditionalGroup = false; | ||
var insideAtExtend = false; | ||
var insideAtImport = false; | ||
var insideNonNestedAtRule = false; | ||
var insideScssMap = false; | ||
@@ -1279,6 +1278,28 @@ var topCharacter = this._ch; | ||
this.eatWhitespace(true); | ||
} else if (this._ch === '@' || this._ch === '$') { | ||
} else if (this._ch === '$') { | ||
this.preserveSingleSpace(isAfterSpace); | ||
// deal with less propery mixins @{...} | ||
this.print_string(this._ch); | ||
// strip trailing space, if present, for hash property checks | ||
var variable = this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g); | ||
if (variable.match(/[ :]$/)) { | ||
// we have a variable or pseudo-class, add it and insert one space before continuing | ||
variable = this.eatString(": ").replace(/\s$/, ''); | ||
this.print_string(variable); | ||
this._output.space_before_token = true; | ||
} | ||
variable = variable.replace(/\s$/, ''); | ||
// might be sass variable | ||
if (parenLevel === 0 && variable.indexOf(':') !== -1) { | ||
insidePropertyValue = true; | ||
this.indent(); | ||
} | ||
} else if (this._ch === '@') { | ||
this.preserveSingleSpace(isAfterSpace); | ||
// deal with less property mixins @{...} | ||
if (this._input.peek() === '{') { | ||
@@ -1301,10 +1322,9 @@ this.print_string(this._ch + this.eatString('}')); | ||
if (variableOrRule === 'extend') { | ||
insideAtExtend = true; | ||
} else if (variableOrRule === 'import') { | ||
insideAtImport = true; | ||
} | ||
// might be less variable | ||
if (parenLevel === 0 && variableOrRule.indexOf(':') !== -1) { | ||
insidePropertyValue = true; | ||
this.indent(); | ||
// might be a nesting at-rule | ||
if (variableOrRule in this.NESTED_AT_RULE) { | ||
// might be a nesting at-rule | ||
} else if (variableOrRule in this.NESTED_AT_RULE) { | ||
this._nestedLevel += 1; | ||
@@ -1314,6 +1334,6 @@ if (variableOrRule in this.CONDITIONAL_GROUP_RULE) { | ||
} | ||
// might be less variable | ||
} else if (!insideRule && parenLevel === 0 && variableOrRule.indexOf(':') !== -1) { | ||
insidePropertyValue = true; | ||
this.indent(); | ||
// might be a non-nested at-rule | ||
} else if (parenLevel === 0 && !insidePropertyValue) { | ||
insideNonNestedAtRule = true; | ||
} | ||
@@ -1330,2 +1350,5 @@ } | ||
// non nested at rule becomes nested | ||
insideNonNestedAtRule = false; | ||
// when entering conditional groups, only rulesets are allowed | ||
@@ -1371,4 +1394,3 @@ if (enteringConditionalGroup) { | ||
} | ||
insideAtImport = false; | ||
insideAtExtend = false; | ||
if (insidePropertyValue) { | ||
@@ -1407,5 +1429,6 @@ this.outdent(); | ||
if ((insideRule || enteringConditionalGroup) && !(this._input.lookBack("&") || this.foundNestedPseudoClass()) && !this._input.lookBack("(") && !insideAtExtend && parenLevel === 0) { | ||
if ((insideRule || enteringConditionalGroup) && !(this._input.lookBack("&") || this.foundNestedPseudoClass()) && !this._input.lookBack("(") && !insideNonNestedAtRule && parenLevel === 0) { | ||
// 'property: value' delimiter | ||
// which could be in a conditional group query | ||
this.print_string(':'); | ||
@@ -1447,4 +1470,3 @@ if (!insidePropertyValue) { | ||
} | ||
insideAtExtend = false; | ||
insideAtImport = false; | ||
insideNonNestedAtRule = false; | ||
this.print_string(this._ch); | ||
@@ -1514,3 +1536,3 @@ this.eatWhitespace(true); | ||
this.eatWhitespace(true); | ||
if (this._options.selector_separator_newline && (!insidePropertyValue || insideScssMap) && parenLevel === 0 && !insideAtImport && !insideAtExtend) { | ||
if (this._options.selector_separator_newline && (!insidePropertyValue || insideScssMap) && parenLevel === 0 && !insideNonNestedAtRule) { | ||
this._output.add_new_line(); | ||
@@ -1517,0 +1539,0 @@ } else { |
@@ -75,3 +75,3 @@ /*--------------------------------------------------------------------------------------------- | ||
TokenType[TokenType["EOS"] = 21] = "EOS"; | ||
})(TokenType = exports.TokenType || (exports.TokenType = {})); | ||
})(TokenType || (exports.TokenType = TokenType = {})); | ||
var ScannerState; | ||
@@ -90,3 +90,3 @@ (function (ScannerState) { | ||
ScannerState[ScannerState["BeforeAttributeValue"] = 10] = "BeforeAttributeValue"; | ||
})(ScannerState = exports.ScannerState || (exports.ScannerState = {})); | ||
})(ScannerState || (exports.ScannerState = ScannerState = {})); | ||
var ClientCapabilities; | ||
@@ -106,3 +106,3 @@ (function (ClientCapabilities) { | ||
}; | ||
})(ClientCapabilities = exports.ClientCapabilities || (exports.ClientCapabilities = {})); | ||
})(ClientCapabilities || (exports.ClientCapabilities = ClientCapabilities = {})); | ||
var FileType; | ||
@@ -126,3 +126,3 @@ (function (FileType) { | ||
FileType[FileType["SymbolicLink"] = 64] = "SymbolicLink"; | ||
})(FileType = exports.FileType || (exports.FileType = {})); | ||
})(FileType || (exports.FileType = FileType = {})); | ||
}); |
@@ -269,3 +269,3 @@ /*--------------------------------------------------------------------------------------------- | ||
if (s.length <= 1) { | ||
return s.replace(/['"]/, ''); | ||
return s.replace(/['"]/, ''); // CodeQL [SM02383] False positive: The string length is at most one, so we don't need the global flag. | ||
} | ||
@@ -272,0 +272,0 @@ if (s[0] === `'` || s[0] === `"`) { |
{ | ||
"name": "vscode-html-languageservice", | ||
"version": "5.0.6", | ||
"version": "5.0.7", | ||
"description": "Language service for HTML", | ||
@@ -20,13 +20,13 @@ "main": "./lib/umd/htmlLanguageService.js", | ||
"@types/node": "16.x", | ||
"@typescript-eslint/eslint-plugin": "^5.59.8", | ||
"@typescript-eslint/parser": "^5.59.8", | ||
"@vscode/web-custom-data": "^0.4.6", | ||
"eslint": "^8.41.0", | ||
"js-beautify": "^1.14.7", | ||
"@typescript-eslint/eslint-plugin": "^6.5.0", | ||
"@typescript-eslint/parser": "^6.5.0", | ||
"@vscode/web-custom-data": "^0.4.7", | ||
"eslint": "^8.48.0", | ||
"js-beautify": "^1.14.9", | ||
"mocha": "^10.2.0", | ||
"rimraf": "^5.0.1", | ||
"typescript": "^5.0.4" | ||
"typescript": "^5.2.2" | ||
}, | ||
"dependencies": { | ||
"@vscode/l10n": "^0.0.14", | ||
"@vscode/l10n": "^0.0.16", | ||
"vscode-languageserver-textdocument": "^1.0.8", | ||
@@ -33,0 +33,0 @@ "vscode-languageserver-types": "^3.17.3", |
@@ -68,3 +68,3 @@ # vscode-html-languageservice | ||
With the exceptions of `data/*.json`, which is built upon content from [Mozilla Developer Network](https://developer.mozilla.org/en-US/docs/Web) | ||
`src/languageFacts/data/webCustomData.ts` is built upon content from [Mozilla Developer Network](https://developer.mozilla.org/en-US/docs/Web) | ||
and distributed under CC BY-SA 2.5. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1573928
77
33025
+ Added@vscode/l10n@0.0.16(transitive)
- Removed@vscode/l10n@0.0.14(transitive)
Updated@vscode/l10n@^0.0.16