volar-service-pug
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -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" | ||
} |
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
37186
849
+ Addedvolar-service-html@0.0.2(transitive)
- Removedvolar-service-html@0.0.1(transitive)
Updatedvolar-service-html@0.0.2