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

vscode-pug-languageservice

Package Overview
Dependencies
Maintainers
1
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vscode-pug-languageservice - npm Package Compare versions

Comparing version 0.25.2 to 0.25.3

LICENSE

3

out/index.d.ts

@@ -112,7 +112,6 @@ import type * as html from 'vscode-html-languageservice';

scan: () => html.TokenType;
getTokenType: () => html.TokenType;
getTokenOffset: () => number;
getTokenLength: () => number;
getTokenEnd: () => number;
getTokenText: () => string;
getTokenLength: () => number;
getTokenError: () => string | undefined;

@@ -119,0 +118,0 @@ getScannerState: () => html.ScannerState;

@@ -5,9 +5,8 @@ import * as html from 'vscode-html-languageservice';

scan: () => html.TokenType;
getTokenType: () => html.TokenType;
getTokenOffset: () => number;
getTokenLength: () => number;
getTokenEnd: () => number;
getTokenText: () => string;
getTokenLength: () => number;
getTokenError: () => string | undefined;
getScannerState: () => html.ScannerState;
} | undefined;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.register = void 0;
const html = require("vscode-html-languageservice");
function register(htmlLs) {

@@ -15,28 +14,37 @@ return (pugDoc, initialOffset = 0) => {

const htmlScanner = htmlLs.createScanner(pugDoc.htmlCode, htmlRange.start);
let token = html.TokenType.Unknown;
let offset = 0;
let end = 0;
let offset;
let end;
return {
scan,
getTokenType: () => token,
getTokenOffset: () => offset,
scan: () => {
offset = undefined;
end = undefined;
return htmlScanner.scan();
},
getTokenOffset: () => {
getTokenRange();
return offset;
},
getTokenEnd: () => {
getTokenRange();
return end;
},
getTokenText: htmlScanner.getTokenText,
getTokenLength: htmlScanner.getTokenLength,
getTokenEnd: () => end,
getTokenText: () => pugDoc.pugCode.substring(offset, end),
getTokenError: htmlScanner.getTokenError,
getScannerState: htmlScanner.getScannerState,
};
function scan() {
token = htmlScanner.scan();
const htmlOffset = htmlScanner.getTokenOffset();
const htmlEnd = htmlScanner.getTokenEnd();
const pugRange = pugDoc.sourceMap.getSourceRange2(htmlOffset, htmlEnd);
if (pugRange) {
offset = pugRange.start;
end = pugRange.end;
return token;
function getTokenRange() {
if (offset === undefined || end === undefined) {
const htmlOffset = htmlScanner.getTokenOffset();
const htmlEnd = htmlScanner.getTokenEnd();
const pugRange = pugDoc.sourceMap.getSourceRange2(htmlOffset, htmlEnd);
if (pugRange) {
offset = pugRange.start;
end = pugRange.end;
}
else {
offset = -1;
end = -1;
}
}
else {
return html.TokenType.Unknown;
}
}

@@ -43,0 +51,0 @@ };

{
"name": "vscode-pug-languageservice",
"version": "0.25.2",
"version": "0.25.3",
"main": "out/index.js",
"license": "MIT",
"files": [
"out"
"out/**/*.js",
"out/**/*.d.ts"
],
"repository": {
"type": "git",
"url": "https://github.com/johnsoncodehk/volar.git"
"url": "https://github.com/johnsoncodehk/volar.git",
"directory": "packages/vscode-pug-languageservice"
},

@@ -17,6 +20,6 @@ "devDependencies": {

"dependencies": {
"@volar/code-gen": "^0.25.2",
"@volar/shared": "^0.25.2",
"@volar/source-map": "^0.25.2",
"@volar/transforms": "^0.25.2",
"@volar/code-gen": "^0.25.3",
"@volar/shared": "^0.25.3",
"@volar/source-map": "^0.25.3",
"@volar/transforms": "^0.25.3",
"pug-beautify": "^0.1.1",

@@ -27,3 +30,3 @@ "pug-lexer": "^5.0.1",

},
"gitHead": "58854fa21cbf3f4e6f1cc7c2100c2c6cebbdd394"
"gitHead": "0c789d67b90c30378b978852e8a6a5321e03cc29"
}
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