vscode-pug-languageservice
Advanced tools
Comparing version 0.32.0 to 0.32.1
@@ -26,3 +26,3 @@ "use strict"; | ||
ast = pugParser(tokens, { filename: fileName, src: pugCode }); | ||
visitNode(ast, undefined); | ||
visitNode(ast, undefined, undefined); | ||
// support tag auto-complete in empty lines | ||
@@ -64,6 +64,6 @@ for (const emptyLineEnd of emptyLineEnds) { | ||
}; | ||
function visitNode(node, next) { | ||
function visitNode(node, next, parent) { | ||
if (node.type === 'Block') { | ||
for (let i = 0; i < node.nodes.length; i++) { | ||
visitNode(node.nodes[i], node.nodes[i + 1]); | ||
visitNode(node.nodes[i], node.nodes[i + 1], node); | ||
} | ||
@@ -78,4 +78,4 @@ } | ||
if (!selfClosing) { | ||
visitNode(node.block, next); | ||
addEndTag(node, next); | ||
visitNode(node.block, next, parent); | ||
addEndTag(node, next, parent); | ||
} | ||
@@ -133,4 +133,4 @@ const fullHtmlEnd = codeGen.getText().length; | ||
} | ||
function addEndTag(node, next) { | ||
let nextStart = pugCode.length; | ||
function addEndTag(node, next, parent) { | ||
let nextStart; | ||
if (next) { | ||
@@ -144,7 +144,12 @@ if (next.type === 'Block') { | ||
} | ||
fullPugTagEnd = nextStart; | ||
codeGen.addCode('', { | ||
start: nextStart, | ||
end: nextStart, | ||
}, SourceMap.Mode.Totally, undefined); | ||
else if (!parent) { | ||
nextStart = pugCode.length; | ||
} | ||
if (nextStart !== undefined) { | ||
fullPugTagEnd = nextStart; | ||
codeGen.addCode('', { | ||
start: nextStart, | ||
end: nextStart, | ||
}, SourceMap.Mode.Totally, undefined); | ||
} | ||
codeGen.addText(`</${node.name}>`); | ||
@@ -151,0 +156,0 @@ } |
{ | ||
"name": "vscode-pug-languageservice", | ||
"version": "0.32.0", | ||
"version": "0.32.1", | ||
"main": "out/index.js", | ||
@@ -19,6 +19,6 @@ "license": "MIT", | ||
"dependencies": { | ||
"@volar/code-gen": "0.32.0", | ||
"@volar/shared": "0.32.0", | ||
"@volar/source-map": "0.32.0", | ||
"@volar/transforms": "0.32.0", | ||
"@volar/code-gen": "0.32.1", | ||
"@volar/shared": "0.32.1", | ||
"@volar/source-map": "0.32.1", | ||
"@volar/transforms": "0.32.1", | ||
"pug-lexer": "^5.0.1", | ||
@@ -29,3 +29,3 @@ "pug-parser": "^6.0.0", | ||
}, | ||
"gitHead": "a2ef5fbe5813e390a2ab5970905e4cf12a3f829c" | ||
"gitHead": "fb6912ca300ae0a0f4ca0d0aa4c17f691dd930ef" | ||
} |
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
29248
608
+ Added@volar/code-gen@0.32.1(transitive)
+ Added@volar/shared@0.32.1(transitive)
+ Added@volar/source-map@0.32.1(transitive)
+ Added@volar/transforms@0.32.1(transitive)
- Removed@volar/code-gen@0.32.0(transitive)
- Removed@volar/shared@0.32.0(transitive)
- Removed@volar/source-map@0.32.0(transitive)
- Removed@volar/transforms@0.32.0(transitive)
Updated@volar/code-gen@0.32.1
Updated@volar/shared@0.32.1
Updated@volar/source-map@0.32.1
Updated@volar/transforms@0.32.1