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

volar-service-pug

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

volar-service-pug - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

10

out/index.d.ts

@@ -1,9 +0,9 @@

import type { InjectionKey, Service, ServiceContext } from '@volar/language-service';
import { InjectionKey, Service, ServiceContext } from '@volar/language-service';
import type * as html from 'vscode-html-languageservice';
import { TextDocument } from 'vscode-languageserver-textdocument';
import * as pug from './languageService';
export declare const rulesInjectionKey: InjectionKey<{
pugDocument: pug.PugDocument;
languageService: pug.LanguageService;
}>;
export declare const injectionKeys: {
pugDocument: InjectionKey<[TextDocument], pug.PugDocument>;
languageService: InjectionKey<[], pug.LanguageService>;
};
export interface PluginInstance extends ReturnType<Service> {

@@ -10,0 +10,0 @@ getHtmlLs: () => html.LanguageService;

@@ -29,7 +29,11 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.rulesInjectionKey = void 0;
exports.injectionKeys = void 0;
const volar_service_html_1 = __importDefault(require("volar-service-html"));
const language_service_1 = require("@volar/language-service");
const language_service_2 = require("@volar/language-service");
const pug = __importStar(require("./languageService"));
exports.rulesInjectionKey = Symbol();
exports.injectionKeys = {
pugDocument: 'pug/pugDocument',
languageService: 'pug/languageService',
};
exports.default = () => (context) => {

@@ -43,13 +47,5 @@ if (!context) {

return {
rules: {
provide: {
[exports.rulesInjectionKey](document) {
return worker(document, (pugDocument) => {
return {
pugDocument,
languageService: pugLs,
};
});
},
},
provide: {
...(0, language_service_1.defineProvide)(exports.injectionKeys.pugDocument, getPugDocument),
...(0, language_service_1.defineProvide)(exports.injectionKeys.languageService, () => pugLs),
},

@@ -101,3 +97,3 @@ ...htmlPlugin,

const htmlResult = await htmlPlugin.provideDocumentSymbols?.(pugDoc.map.virtualFileDocument, token) ?? [];
const pugResult = htmlResult.map(htmlSymbol => language_service_1.transformer.asDocumentSymbol(htmlSymbol, range => pugDoc.map.toSourceRange(range))).filter((symbol) => symbol !== undefined);
const pugResult = htmlResult.map(htmlSymbol => language_service_2.transformer.asDocumentSymbol(htmlSymbol, range => pugDoc.map.toSourceRange(range))).filter((symbol) => symbol !== undefined);
return pugResult;

@@ -104,0 +100,0 @@ });

{
"name": "volar-service-pug",
"version": "0.0.1",
"version": "0.0.2",
"main": "out/index.js",

@@ -19,3 +19,3 @@ "license": "MIT",

"pug-parser": "^6.0.0",
"volar-service-html": "0.0.1",
"volar-service-html": "0.0.2",
"vscode-html-languageservice": "^5.0.4",

@@ -32,3 +32,3 @@ "vscode-languageserver-textdocument": "^1.0.8",

},
"gitHead": "5bf5152f076f25cb1ddbc7aa6978a8d1c7009fd6"
"gitHead": "19482084693c7349f461dc75ec52ee6917739c51"
}
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