New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.4 to 0.0.5

51

out/index.js

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

Object.defineProperty(exports, "__esModule", { value: true });
const path = __importStar(require("path"));
const path_1 = require("path");
const css = __importStar(require("vscode-css-languageservice"));
const vscode_uri_1 = require("vscode-uri");
exports.default = () => (context) => {

@@ -37,5 +38,37 @@ // https://github.com/microsoft/vscode/blob/09850876e652688fb142e2e19fd00fd38c0bc4ba/extensions/css-language-features/server/src/cssServer.ts#L97

const stylesheets = new WeakMap();
const cssLs = css.getCSSLanguageService({ fileSystemProvider: context.env.fileSystemProvider });
const scssLs = css.getSCSSLanguageService({ fileSystemProvider: context.env.fileSystemProvider });
const lessLs = css.getLESSLanguageService({ fileSystemProvider: context.env.fileSystemProvider });
const fileSystemProvider = {
stat: async (uri) => await context.env.fs?.stat(uri) ?? {
type: css.FileType.Unknown,
ctime: 0,
mtime: 0,
size: 0,
},
readDirectory: async (uri) => context.env.fs?.readDirectory(uri) ?? [],
};
const documentContext = {
resolveReference(ref, base) {
if (ref.match(/^\w[\w\d+.-]*:/)) {
// starts with a schema
return ref;
}
if (ref[0] === '/') { // resolve absolute path against the current workspace folder
return base + ref;
}
const baseUri = vscode_uri_1.URI.parse(base);
const baseUriDir = baseUri.path.endsWith('/') ? baseUri : vscode_uri_1.Utils.dirname(baseUri);
return vscode_uri_1.Utils.resolvePath(baseUriDir, ref).toString(true);
},
};
const cssLs = css.getCSSLanguageService({
fileSystemProvider,
clientCapabilities: context.env.clientCapabilities,
});
const scssLs = css.getSCSSLanguageService({
fileSystemProvider,
clientCapabilities: context.env.clientCapabilities,
});
const lessLs = css.getLESSLanguageService({
fileSystemProvider,
clientCapabilities: context.env.clientCapabilities,
});
const postcssLs = {

@@ -60,5 +93,3 @@ ...scssLs,

const settings = await context.env.getConfiguration?.(document.languageId);
const cssResult = context.env.documentContext
? await cssLs.doComplete2(document, position, stylesheet, context.env.documentContext, settings?.completion)
: await cssLs.doComplete(document, position, stylesheet, settings?.completion);
const cssResult = await cssLs.doComplete2(document, position, stylesheet, documentContext, settings?.completion);
return cssResult;

@@ -118,5 +149,3 @@ });

return await worker(document, (stylesheet, cssLs) => {
if (!context.env.documentContext)
return;
return cssLs.findDocumentLinks2(document, stylesheet, context.env.documentContext);
return cssLs.findDocumentLinks2(document, stylesheet, documentContext);
});

@@ -182,3 +211,3 @@ },

try {
const jsonPath = path.resolve(customDataPath);
const jsonPath = path_1.posix.resolve(customDataPath);
newData.push(css.newCSSDataProvider(require(jsonPath)));

@@ -185,0 +214,0 @@ }

{
"name": "volar-service-css",
"version": "0.0.4",
"version": "0.0.5",
"main": "out/index.js",

@@ -16,3 +16,4 @@ "license": "MIT",

"dependencies": {
"vscode-css-languageservice": "^6.2.3"
"vscode-css-languageservice": "^6.2.3",
"vscode-uri": "^3.0.7"
},

@@ -22,3 +23,3 @@ "devDependencies": {

},
"gitHead": "f5d49495d6698761f4df8c9ef2747cc01fc777d6"
"gitHead": "7b58234769e16ccb8eed0e6eb03f58ed24b7df40"
}
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