Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vscode-html-languageservice

Package Overview
Dependencies
Maintainers
5
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vscode-html-languageservice - npm Package Compare versions

Comparing version 4.0.7 to 4.0.8

2

lib/umd/htmlLanguageService.js

@@ -53,3 +53,3 @@ /*---------------------------------------------------------------------------------------------

createScanner: htmlScanner_1.createScanner,
parseHTMLDocument: function (document) { return htmlParser_1.parse(document.getText()); },
parseHTMLDocument: function (document) { return (0, htmlParser_1.parse)(document.getText()); },
doComplete: htmlCompletion.doComplete.bind(htmlCompletion),

@@ -56,0 +56,0 @@ doComplete2: htmlCompletion.doComplete2.bind(htmlCompletion),

@@ -105,3 +105,3 @@ /*---------------------------------------------------------------------------------------------

if (item.description && settings.documentation !== false) {
var normalizedDescription = markup_1.normalizeMarkupContent(item.description);
var normalizedDescription = (0, markup_1.normalizeMarkupContent)(item.description);
if (normalizedDescription) {

@@ -108,0 +108,0 @@ result.value += normalizedDescription.value;

@@ -53,3 +53,3 @@ /*---------------------------------------------------------------------------------------------

Node.prototype.findNodeBefore = function (offset) {
var idx = arrays_1.findFirst(this.children, function (c) { return offset <= c.start; }) - 1;
var idx = (0, arrays_1.findFirst)(this.children, function (c) { return offset <= c.start; }) - 1;
if (idx >= 0) {

@@ -71,3 +71,3 @@ var child = this.children[idx];

Node.prototype.findNodeAt = function (offset) {
var idx = arrays_1.findFirst(this.children, function (c) { return offset <= c.start; }) - 1;
var idx = (0, arrays_1.findFirst)(this.children, function (c) { return offset <= c.start; }) - 1;
if (idx >= 0) {

@@ -85,3 +85,3 @@ var child = this.children[idx];

function parse(text) {
var scanner = htmlScanner_1.createScanner(text, undefined, undefined, true);
var scanner = (0, htmlScanner_1.createScanner)(text, undefined, undefined, true);
var htmlDocument = new Node(0, text.length, [], void 0);

@@ -108,3 +108,3 @@ var curr = htmlDocument;

curr.startTagEnd = scanner.getTokenEnd();
if (curr.tag && fact_1.isVoidElement(curr.tag)) {
if (curr.tag && (0, fact_1.isVoidElement)(curr.tag)) {
curr.closed = true;

@@ -111,0 +111,0 @@ curr = curr.parent;

@@ -121,3 +121,3 @@ /*---------------------------------------------------------------------------------------------

}
var scanner = htmlScanner_1.createScanner(text, node.start);
var scanner = (0, htmlScanner_1.createScanner)(text, node.start);
var currentTag = '';

@@ -139,3 +139,3 @@ var currentAttributeName;

kind: htmlLanguageTypes_1.CompletionItemKind.Property,
documentation: dataProvider_1.generateDocumentation(tag, undefined, doesSupportMarkdown),
documentation: (0, dataProvider_1.generateDocumentation)(tag, undefined, doesSupportMarkdown),
textEdit: htmlLanguageTypes_1.TextEdit.replace(range, tag.name),

@@ -200,3 +200,3 @@ insertTextFormat: htmlLanguageTypes_1.InsertTextFormat.PlainText

kind: htmlLanguageTypes_1.CompletionItemKind.Property,
documentation: dataProvider_1.generateDocumentation(tag, undefined, doesSupportMarkdown),
documentation: (0, dataProvider_1.generateDocumentation)(tag, undefined, doesSupportMarkdown),
filterText: '/' + tag.name + closeTag,

@@ -214,3 +214,3 @@ textEdit: htmlLanguageTypes_1.TextEdit.replace(range, '/' + tag.name + closeTag),

}
if (!fact_1.isVoidElement(tag)) {
if (!(0, fact_1.isVoidElement)(tag)) {
var pos = document.positionAt(tagCloseEnd);

@@ -271,3 +271,3 @@ result.items.push({

kind: attr.valueSet === 'handler' ? htmlLanguageTypes_1.CompletionItemKind.Function : htmlLanguageTypes_1.CompletionItemKind.Value,
documentation: dataProvider_1.generateDocumentation(attr, undefined, doesSupportMarkdown),
documentation: (0, dataProvider_1.generateDocumentation)(attr, undefined, doesSupportMarkdown),
textEdit: htmlLanguageTypes_1.TextEdit.replace(range, codeSnippet),

@@ -288,3 +288,3 @@ insertTextFormat: htmlLanguageTypes_1.InsertTextFormat.Snippet,

node.attributeNames.forEach(function (attr) {
if (strings_1.startsWith(attr, dataAttr) && !dataAttributes[attr] && !seenAttributes[attr]) {
if ((0, strings_1.startsWith)(attr, dataAttr) && !dataAttributes[attr] && !seenAttributes[attr]) {
dataAttributes[attr] = attr + '="$1"';

@@ -347,3 +347,3 @@ }

kind: htmlLanguageTypes_1.CompletionItemKind.Unit,
documentation: dataProvider_1.generateDocumentation(value, undefined, doesSupportMarkdown),
documentation: (0, dataProvider_1.generateDocumentation)(value, undefined, doesSupportMarkdown),
textEdit: htmlLanguageTypes_1.TextEdit.replace(range, insertText),

@@ -379,3 +379,3 @@ insertTextFormat: htmlLanguageTypes_1.InsertTextFormat.PlainText

var characterStart = position.character;
while (k >= 0 && strings_1.isLetterOrDigit(text, k)) {
while (k >= 0 && (0, strings_1.isLetterOrDigit)(text, k)) {
k--;

@@ -387,3 +387,3 @@ characterStart--;

for (var entity in htmlEntities_1.entities) {
if (strings_1.endsWith(entity, ';')) {
if ((0, strings_1.endsWith)(entity, ';')) {
var label = '&' + entity;

@@ -518,4 +518,4 @@ result.items.push({

var node = htmlDocument.findNodeBefore(offset);
if (node && node.tag && !fact_1.isVoidElement(node.tag) && node.start < offset && (!node.endTagStart || node.endTagStart > offset)) {
var scanner = htmlScanner_1.createScanner(document.getText(), node.start);
if (node && node.tag && !(0, fact_1.isVoidElement)(node.tag) && node.start < offset && (!node.endTagStart || node.endTagStart > offset)) {
var scanner = (0, htmlScanner_1.createScanner)(document.getText(), node.start);
var token = scanner.scan();

@@ -536,3 +536,3 @@ while (token !== htmlLanguageTypes_1.TokenType.EOS && scanner.getTokenEnd() <= offset) {

if (node && node.tag) {
var scanner = htmlScanner_1.createScanner(document.getText(), node.start);
var scanner = (0, htmlScanner_1.createScanner)(document.getText(), node.start);
var token = scanner.scan();

@@ -564,4 +564,4 @@ while (token !== htmlLanguageTypes_1.TokenType.EOS && scanner.getTokenEnd() <= offset) {

var _a, _b, _c;
if (!object_1.isDefined(this.supportsMarkdown)) {
if (!object_1.isDefined(this.lsOptions.clientCapabilities)) {
if (!(0, object_1.isDefined)(this.supportsMarkdown)) {
if (!(0, object_1.isDefined)(this.lsOptions.clientCapabilities)) {
this.supportsMarkdown = true;

@@ -585,3 +585,3 @@ return this.supportsMarkdown;

function isFollowedBy(s, offset, intialState, expectedToken) {
var scanner = htmlScanner_1.createScanner(s, offset, intialState);
var scanner = (0, htmlScanner_1.createScanner)(s, offset, intialState);
var token = scanner.scan();

@@ -588,0 +588,0 @@ while (token === htmlLanguageTypes_1.TokenType.Whitespace) {

@@ -91,3 +91,3 @@ /*---------------------------------------------------------------------------------------------

function getFoldingRanges(document, context) {
var scanner = htmlScanner_1.createScanner(document.getText());
var scanner = (0, htmlScanner_1.createScanner)(document.getText());
var token = scanner.scan();

@@ -116,3 +116,3 @@ var ranges = [];

case htmlLanguageTypes_1.TokenType.StartTagClose:
if (!lastTagName || !fact_1.isVoidElement(lastTagName)) {
if (!lastTagName || !(0, fact_1.isVoidElement)(lastTagName)) {
break;

@@ -119,0 +119,0 @@ }

@@ -92,5 +92,5 @@ /*---------------------------------------------------------------------------------------------

};
var result = beautify_html_1.html_beautify(trimLeft(value), htmlOptions);
var result = (0, beautify_html_1.html_beautify)(trimLeft(value), htmlOptions);
if (initialIndentLevel > 0) {
var indent = options.insertSpaces ? strings_1.repeat(' ', tabSize * initialIndentLevel) : strings_1.repeat('\t', initialIndentLevel);
var indent = options.insertSpaces ? (0, strings_1.repeat)(' ', tabSize * initialIndentLevel) : (0, strings_1.repeat)('\t', initialIndentLevel);
result = result.split('\n').join('\n' + indent);

@@ -97,0 +97,0 @@ if (range.start.character === 0) {

@@ -46,3 +46,3 @@ /*---------------------------------------------------------------------------------------------

function getTagNameRange(tokenType, document, startOffset) {
var scanner = htmlScanner_1.createScanner(document.getText(), startOffset);
var scanner = (0, htmlScanner_1.createScanner)(document.getText(), startOffset);
var token = scanner.scan();

@@ -49,0 +49,0 @@ while (token !== htmlLanguageTypes_1.TokenType.EOS && token !== tokenType) {

@@ -45,3 +45,3 @@ /*---------------------------------------------------------------------------------------------

if (tag.name.toLowerCase() === currTag.toLowerCase()) {
var markupContent = dataProvider_1.generateDocumentation(tag, options, doesSupportMarkdown);
var markupContent = (0, dataProvider_1.generateDocumentation)(tag, options, doesSupportMarkdown);
if (!markupContent) {

@@ -74,3 +74,3 @@ markupContent = {

if (currAttr === attr.name && attr.description) {
var contentsDoc = dataProvider_1.generateDocumentation(attr, options, doesSupportMarkdown);
var contentsDoc = (0, dataProvider_1.generateDocumentation)(attr, options, doesSupportMarkdown);
if (contentsDoc) {

@@ -102,3 +102,3 @@ hover = { contents: contentsDoc, range: range };

if (currAttrValue === attrValue.name && attrValue.description) {
var contentsDoc = dataProvider_1.generateDocumentation(attrValue, options, doesSupportMarkdown);
var contentsDoc = (0, dataProvider_1.generateDocumentation)(attrValue, options, doesSupportMarkdown);
if (contentsDoc) {

@@ -158,3 +158,3 @@ hover = { contents: contentsDoc, range: range };

function getTagNameRange(tokenType, startOffset) {
var scanner = htmlScanner_1.createScanner(document.getText(), startOffset);
var scanner = (0, htmlScanner_1.createScanner)(document.getText(), startOffset);
var token = scanner.scan();

@@ -172,3 +172,3 @@ while (token !== htmlLanguageTypes_1.TokenType.EOS && (scanner.getTokenEnd() < offset || scanner.getTokenEnd() === offset && token !== tokenType)) {

var characterStart = position.character;
while (k >= 0 && strings_1.isLetterOrDigit(text, k)) {
while (k >= 0 && (0, strings_1.isLetterOrDigit)(text, k)) {
k--;

@@ -179,3 +179,3 @@ characterStart--;

var characterEnd = characterStart;
while (strings_1.isLetterOrDigit(text, n)) {
while ((0, strings_1.isLetterOrDigit)(text, n)) {
n++;

@@ -199,7 +199,7 @@ characterEnd++;

var newText = '&';
while (k >= 0 && strings_1.isLetterOrDigit(text, k)) {
while (k >= 0 && (0, strings_1.isLetterOrDigit)(text, k)) {
k--;
}
k = k + 1;
while (strings_1.isLetterOrDigit(text, k)) {
while ((0, strings_1.isLetterOrDigit)(text, k)) {
newText += text[k];

@@ -233,3 +233,3 @@ k += 1;

function scanAttrAndAttrValue(nodeStart, attrValueStart) {
var scanner = htmlScanner_1.createScanner(document.getText(), nodeStart);
var scanner = (0, htmlScanner_1.createScanner)(document.getText(), nodeStart);
var token = scanner.scan();

@@ -283,4 +283,4 @@ var prevAttr = undefined;

var _a, _b, _c;
if (!object_1.isDefined(this.supportsMarkdown)) {
if (!object_1.isDefined(this.lsOptions.clientCapabilities)) {
if (!(0, object_1.isDefined)(this.supportsMarkdown)) {
if (!(0, object_1.isDefined)(this.lsOptions.clientCapabilities)) {
this.supportsMarkdown = true;

@@ -287,0 +287,0 @@ return this.supportsMarkdown;

@@ -89,3 +89,3 @@ /*---------------------------------------------------------------------------------------------

var newLinks = [];
var scanner = htmlScanner_1.createScanner(document.getText(), 0);
var scanner = (0, htmlScanner_1.createScanner)(document.getText(), 0);
var token = scanner.scan();

@@ -92,0 +92,0 @@ var lastAttributeName = undefined;

@@ -41,3 +41,3 @@ /*---------------------------------------------------------------------------------------------

function getApplicableRanges(document, position) {
var htmlDoc = htmlParser_1.parse(document.getText());
var htmlDoc = (0, htmlParser_1.parse)(document.getText());
var currOffset = document.offsetAt(position);

@@ -128,3 +128,3 @@ var currNode = htmlDoc.findNodeAt(currOffset);

*/
var scanner = htmlScanner_1.createScanner(currNodeText);
var scanner = (0, htmlScanner_1.createScanner)(currNodeText);
var token = scanner.scan();

@@ -131,0 +131,0 @@ /**

@@ -137,3 +137,3 @@ /*---------------------------------------------------------------------------------------------

function stripQuotes(fullValue) {
if (strings_1.startsWith(fullValue, "'") || strings_1.startsWith(fullValue, "\"")) {
if ((0, strings_1.startsWith)(fullValue, "'") || (0, strings_1.startsWith)(fullValue, "\"")) {
return fullValue.slice(1, -1);

@@ -146,3 +146,3 @@ }

function isCompletablePath(value) {
if (strings_1.startsWith(value, 'http') || strings_1.startsWith(value, 'https') || strings_1.startsWith(value, '//')) {
if ((0, strings_1.startsWith)(value, 'http') || (0, strings_1.startsWith)(value, 'https') || (0, strings_1.startsWith)(value, '//')) {
return false;

@@ -149,0 +149,0 @@ }

{
"name": "vscode-html-languageservice",
"version": "4.0.7",
"version": "4.0.8",
"description": "Language service for HTML",

@@ -20,10 +20,10 @@ "main": "./lib/umd/htmlLanguageService.js",

"@types/node": "^10.12.21",
"@typescript-eslint/eslint-plugin": "^4.28.1",
"@typescript-eslint/parser": "^4.28.1",
"eslint": "^7.29.0",
"@typescript-eslint/eslint-plugin": "^4.31.0",
"@typescript-eslint/parser": "^4.31.0",
"eslint": "^7.32.0",
"js-beautify": "^1.14.0",
"mocha": "^8.4.0",
"mocha": "^9.1.1",
"rimraf": "^3.0.2",
"typescript": "^4.3.4",
"vscode-web-custom-data": "^0.3.4"
"typescript": "^4.4.2",
"vscode-web-custom-data": "^0.3.5"
},

@@ -30,0 +30,0 @@ "dependencies": {

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