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

vscode-css-languageservice

Package Overview
Dependencies
Maintainers
4
Versions
185
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vscode-css-languageservice

Language service for CSS, LESS and SCSS

  • 1.0.7-next.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
398K
decreased by-50.1%
Maintainers
4
Weekly downloads
 
Created

What is vscode-css-languageservice?

The vscode-css-languageservice package provides a set of tools and services for working with CSS in a way that integrates seamlessly with Visual Studio Code. It offers features like CSS validation, completion, hover information, and more, making it easier for developers to write and maintain CSS code.

What are vscode-css-languageservice's main functionalities?

CSS Validation

This feature allows you to validate CSS code and get diagnostics information. The code sample demonstrates how to create a CSS language service, parse a stylesheet, and perform validation to get diagnostics.

const cssService = require('vscode-css-languageservice').getCSSLanguageService();
const document = { uri: 'test.css', languageId: 'css', version: 1, getText: () => 'body { color: red; }' };
const stylesheet = cssService.parseStylesheet(document);
const diagnostics = cssService.doValidation(document, stylesheet);
console.log(diagnostics);

CSS Completion

This feature provides code completion suggestions for CSS. The code sample shows how to get completion items for a given position in a CSS document.

const cssService = require('vscode-css-languageservice').getCSSLanguageService();
const document = { uri: 'test.css', languageId: 'css', version: 1, getText: () => 'body { col' } };
const position = { line: 0, character: 10 };
const stylesheet = cssService.parseStylesheet(document);
const completions = cssService.doComplete(document, position, stylesheet);
console.log(completions);

CSS Hover Information

This feature provides hover information for CSS code. The code sample demonstrates how to get hover information for a specific position in a CSS document.

const cssService = require('vscode-css-languageservice').getCSSLanguageService();
const document = { uri: 'test.css', languageId: 'css', version: 1, getText: () => 'body { color: red; }' };
const position = { line: 0, character: 7 };
const stylesheet = cssService.parseStylesheet(document);
const hover = cssService.doHover(document, position, stylesheet);
console.log(hover);

Other packages similar to vscode-css-languageservice

FAQs

Package last updated on 09 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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