项目作者: vscode-langservers

项目描述 :
Binary version published on npm of vscode-css-languageserver extracted from VSCode tree
高级语言: JavaScript
项目地址: git://github.com/vscode-langservers/vscode-css-languageserver-bin.git
创建时间: 2017-08-13T14:35:39Z
项目社区:https://github.com/vscode-langservers/vscode-css-languageserver-bin

开源协议:MIT License

下载


vscode-css-languageserver-bin

npm
Join the chat at https://gitter.im/vscode-langservers/Lobby

Binary version published on npm of vscode-css-languageserver extracted from VSCode tree

Features

  • CSS Support
  • LESS Support
  • SASS Support
  • Completion provider (Need Snippets Support)
  • Color provider
  • Code Actions (rename mispelled properties)
  • Validation (syntax and lint errros)
  • [X] Hover tooltip provider
  • Definition provider
  • Hover provider
  • References provider
  • Document Symbols & Highlights
  • Rename symbol
  • Scoped Settings

Clients

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

To install this Language Server you need npm on your machine

Installing

  1. npm install --global vscode-css-languageserver-bin

Launching the Server

The common way to launch it is by using stdio transport:

  1. css-languageserver --stdio

The server can also be launched with one of the following transports:

  1. css-languageserver --socket={number}
  2. css-languageserver --node-ipc

Settings

This Language Server accepts some settings sent with workspace/didChangeConfiguration

  1. type Level = "ignore" | "error" | "warning"
  2. type LintSettings = {
  3. // From: https://github.com/Microsoft/vscode-css-languageservice/blob/master/src/services/lintRules.ts#L25
  4. compatibleVendorPrefixes?: Level, // When using a vendor-specific prefix make sure to also include all other vendor-specific properties. Default: Ignore
  5. vendorPrefix?: Level, // When using a vendor-specific prefix also include the standard property. Default: Warning
  6. duplicateProperties?: Level, //, localize('rule.duplicateDeclarations', "Do not use duplicate style definitions. Default: Ignore
  7. emptyRules?: Level, // Do not use empty rulesets. Default: Warning
  8. importStatement?: Level, // Import statements do not load in parallel. Default: Ignore
  9. boxModel?: Level, // Do not use width or height when using padding or border. Default: Ignore
  10. universalSelector?: Level, // The universal selector (*) is known to be slow. Default: Ignore
  11. zeroUnits?: Level, // No unit for zero needed. Default: Ignore
  12. fontFaceProperties?: Level, // @font-face rule must define 'src' and 'font-family' properties. Default: Warning
  13. hexColorLength?: Level, // Hex colors must consist of three, four, six or eight hex numbers. Default: Error
  14. argumentsInColorFunction?: Level, // Invalid number of parameters. Default: Error
  15. unknownProperties?: Level, // Unknown property. Default: Warning
  16. ieHack?: Level, // IE hacks are only necessary when supporting IE7 and older. Default: Ignore
  17. unknownVendorSpecificProperties?: Level // Unknown vendor specific property. Default: Ignore
  18. propertyIgnoredDueToDisplay?: Level, // Property is ignored due to the display. Default: Warning
  19. important?: Level, // Avoid using !important. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored. Default: Ignore
  20. float?: Level, // Avoid using 'float'. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes. Default: Ignore
  21. idSelector?: Level // Selectors should not contain IDs because these rules are too tightly coupled with the HTML. Default: Ignore
  22. };
  23. interface LanguageSettings {
  24. validate?: boolean;
  25. lint?: LintSettings;
  26. }
  27. interface Settings {
  28. css?: LanguageSettings,
  29. scss?: LanguageSettings,
  30. less?: LanguageSettings
  31. }

Deployment

  1. npm run publish
  2. # or to try locally
  3. npm run pack

Contributing

PRs are welcome.
To setup the repo locally run:

  1. git clone --recursive https://github.com/vscode-langservers/vscode-css-languageserver-bin
  2. cd vscode-css-languageserver-bin
  3. npm install
  4. npm run pack

Versioning

We use SemVer for versioning.

Because we can’t guess VSCode extention version, we update MINOR when submodule is updated and PATCH when only build method is updated

License

This project is licensed under the MIT License - see the LICENSE file for details

This is a derived work please see VSCode’s LICENSE.txt for the original copyright and license.