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

volar-service-css

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

volar-service-css - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1

7

out/index.d.ts

@@ -1,3 +0,8 @@

import type { Service } from '@volar/language-service';
import type { InjectionKey, Service } from '@volar/language-service';
import * as css from 'vscode-css-languageservice';
export declare const rulesInjectionKey: InjectionKey<{
stylesheet: css.Stylesheet;
languageService: css.LanguageService;
}>;
declare const _default: () => Service;
export default _default;

27

out/index.js

@@ -26,5 +26,7 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.rulesInjectionKey = void 0;
const css = __importStar(require("vscode-css-languageservice"));
const vscode = __importStar(require("vscode-languageserver-protocol"));
const path = __importStar(require("path"));
exports.rulesInjectionKey = Symbol();
exports.default = () => (context) => {

@@ -52,12 +54,19 @@ // https://github.com/microsoft/vscode/blob/09850876e652688fb142e2e19fd00fd38c0bc4ba/extensions/css-language-features/server/src/cssServer.ts#L97

return {
rules: {
provide: {
[exports.rulesInjectionKey](document) {
const stylesheet = getStylesheet(document);
if (!stylesheet)
return;
const cssLs = getCssLs(document.languageId);
if (!cssLs)
return;
return {
stylesheet,
languageService: cssLs,
};
},
},
},
triggerCharacters,
async resolveRuleContext(context) {
await worker(context.document, (stylesheet, cssLs) => {
context.css = {
stylesheet,
languageService: cssLs,
};
});
return context;
},
async provideCompletionItems(document, position) {

@@ -64,0 +73,0 @@ return worker(document, async (stylesheet, cssLs) => {

{
"name": "volar-service-css",
"version": "0.0.0",
"version": "0.0.1",
"main": "out/index.js",
"license": "MIT",
"files": [
"rules.d.ts",
"out/**/*.js",

@@ -29,3 +28,3 @@ "out/**/*.d.ts"

},
"gitHead": "1011561ac4bbf79c53c3b80c27692569bf861519"
"gitHead": "5bf5152f076f25cb1ddbc7aa6978a8d1c7009fd6"
}
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