├── .gitmodules ├── package.json ├── LICENSE ├── .gitignore └── README.md /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "vscode-css-languageserver"] 2 | path = vscode-css-languageserver 3 | url = https://github.com/vscode-langservers/vscode-css-languageserver.git 4 | ignore = dirty 5 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vscode-css-languageserver-bin", 3 | "description": "Binary version published on npm of vscode-css-languageserver extracted from VSCode tree", 4 | "version": "1.4.0", 5 | "repository": { 6 | "type": "git", 7 | "url": "git+https://github.com/vscode-langservers/vscode-css-languageserver-bin.git" 8 | }, 9 | "author": "VSCode Langservers", 10 | "license": "MIT", 11 | "bugs": { 12 | "url": "https://github.com/vscode-langservers/vscode-css-languageserver-bin/issues" 13 | }, 14 | "homepage": "https://github.com/vscode-langservers/vscode-css-languageserver-bin#readme", 15 | "devDependencies": { 16 | "chalk": "^2.3.0", 17 | "typescript": "^2.4.2" 18 | }, 19 | "bin": { 20 | "css-languageserver": "cssServerMain.js" 21 | }, 22 | "scripts": { 23 | "build": "node build", 24 | "publish": "npm run build && npm publish dist", 25 | "pack": "npm run build && npm pack dist", 26 | "clean": "rm -rf dist" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 VSCode Langservers 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | 3 | # Logs 4 | logs 5 | *.log 6 | npm-debug.log* 7 | yarn-debug.log* 8 | yarn-error.log* 9 | 10 | # Runtime data 11 | pids 12 | *.pid 13 | *.seed 14 | *.pid.lock 15 | 16 | # Directory for instrumented libs generated by jscoverage/JSCover 17 | lib-cov 18 | 19 | # Coverage directory used by tools like istanbul 20 | coverage 21 | 22 | # nyc test coverage 23 | .nyc_output 24 | 25 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 26 | .grunt 27 | 28 | # Bower dependency directory (https://bower.io/) 29 | bower_components 30 | 31 | # node-waf configuration 32 | .lock-wscript 33 | 34 | # Compiled binary addons (http://nodejs.org/api/addons.html) 35 | build/Release 36 | 37 | # Dependency directories 38 | node_modules/ 39 | jspm_packages/ 40 | 41 | # Typescript v1 declaration files 42 | typings/ 43 | 44 | # Optional npm cache directory 45 | .npm 46 | 47 | # Optional eslint cache 48 | .eslintcache 49 | 50 | # Optional REPL history 51 | .node_repl_history 52 | 53 | # Output of 'npm pack' 54 | *.tgz 55 | 56 | # Yarn Integrity file 57 | .yarn-integrity 58 | 59 | # dotenv environment variables file 60 | .env 61 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vscode-css-languageserver-bin 2 | 3 | [![npm](https://img.shields.io/npm/v/vscode-css-languageserver-bin.svg)](https://www.npmjs.com/package/vscode-css-languageserver-bin) 4 | [![Join the chat at https://gitter.im/vscode-langservers/Lobby](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/vscode-langservers/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 5 | 6 | Binary version published on npm of [vscode-css-languageserver](https://github.com/vscode-langservers/vscode-css-languageserver) extracted from [VSCode tree](https://github.com/Microsoft/vscode/tree/master/extensions/css/server) 7 | 8 | # Features 9 | 10 | - [x] CSS Support 11 | - [x] LESS Support 12 | - [x] SASS Support 13 | - [x] Completion provider (Need Snippets Support) 14 | - [x] [Color provider](https://github.com/Microsoft/vscode-languageserver-node/blob/master/protocol/src/protocol.colorProvider.proposed.md) 15 | - [x] Code Actions (rename mispelled properties) 16 | - [x] Validation (syntax and lint errros) 17 | - [X] Hover tooltip provider 18 | - [x] Definition provider 19 | - [x] Hover provider 20 | - [x] References provider 21 | - [x] Document Symbols & Highlights 22 | - [x] Rename symbol 23 | - [x] [Scoped Settings](https://github.com/Microsoft/vscode-languageserver-node/blob/master/protocol/src/protocol.configuration.proposed.md) 24 | 25 | # Clients 26 | 27 | - [Oni](https://github.com/onivim/oni) 28 | - [ide-css](https://github.com/liuderchi/ide-css) 29 | - [lsp-css](https://github.com/emacs-lsp/lsp-css) 30 | 31 | ## Getting Started 32 | 33 | 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. 34 | 35 | ### Prerequisites 36 | 37 | To install this Language Server you need [npm](https://www.npmjs.com/get-npm) on your machine 38 | 39 | ### Installing 40 | 41 | ```bash 42 | npm install --global vscode-css-languageserver-bin 43 | ``` 44 | 45 | ### Launching the Server 46 | 47 | The common way to launch it is by using stdio transport: 48 | 49 | ```bash 50 | css-languageserver --stdio 51 | ``` 52 | 53 | The server can also be launched with one of the following transports: 54 | 55 | ```bash 56 | css-languageserver --socket={number} 57 | css-languageserver --node-ipc 58 | ``` 59 | 60 | ## Settings 61 | 62 | This Language Server accepts some settings sent with [workspace/didChangeConfiguration](https://microsoft.github.io/language-server-protocol/specification#workspace_didChangeConfiguration) 63 | 64 | ```typescript 65 | type Level = "ignore" | "error" | "warning" 66 | 67 | type LintSettings = { 68 | // From: https://github.com/Microsoft/vscode-css-languageservice/blob/master/src/services/lintRules.ts#L25 69 | 70 | compatibleVendorPrefixes?: Level, // When using a vendor-specific prefix make sure to also include all other vendor-specific properties. Default: Ignore 71 | vendorPrefix?: Level, // When using a vendor-specific prefix also include the standard property. Default: Warning 72 | duplicateProperties?: Level, //, localize('rule.duplicateDeclarations', "Do not use duplicate style definitions. Default: Ignore 73 | emptyRules?: Level, // Do not use empty rulesets. Default: Warning 74 | importStatement?: Level, // Import statements do not load in parallel. Default: Ignore 75 | boxModel?: Level, // Do not use width or height when using padding or border. Default: Ignore 76 | universalSelector?: Level, // The universal selector (*) is known to be slow. Default: Ignore 77 | zeroUnits?: Level, // No unit for zero needed. Default: Ignore 78 | fontFaceProperties?: Level, // @font-face rule must define 'src' and 'font-family' properties. Default: Warning 79 | hexColorLength?: Level, // Hex colors must consist of three, four, six or eight hex numbers. Default: Error 80 | argumentsInColorFunction?: Level, // Invalid number of parameters. Default: Error 81 | unknownProperties?: Level, // Unknown property. Default: Warning 82 | ieHack?: Level, // IE hacks are only necessary when supporting IE7 and older. Default: Ignore 83 | unknownVendorSpecificProperties?: Level // Unknown vendor specific property. Default: Ignore 84 | propertyIgnoredDueToDisplay?: Level, // Property is ignored due to the display. Default: Warning 85 | 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 86 | float?: Level, // Avoid using 'float'. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes. Default: Ignore 87 | idSelector?: Level // Selectors should not contain IDs because these rules are too tightly coupled with the HTML. Default: Ignore 88 | }; 89 | 90 | interface LanguageSettings { 91 | validate?: boolean; 92 | lint?: LintSettings; 93 | } 94 | 95 | interface Settings { 96 | css?: LanguageSettings, 97 | scss?: LanguageSettings, 98 | less?: LanguageSettings 99 | } 100 | ``` 101 | 102 | ## Deployment 103 | 104 | ```bash 105 | npm run publish 106 | # or to try locally 107 | npm run pack 108 | ``` 109 | 110 | ## Contributing 111 | 112 | PRs are welcome. 113 | To setup the repo locally run: 114 | ```bash 115 | git clone --recursive https://github.com/vscode-langservers/vscode-css-languageserver-bin 116 | cd vscode-css-languageserver-bin 117 | npm install 118 | npm run pack 119 | ``` 120 | 121 | ## Versioning 122 | 123 | We use [SemVer](http://semver.org/) for versioning. 124 | 125 | Because we [can't guess](https://github.com/vscode-langservers/vscode-css-languageserver/blob/master/package.json#L4) VSCode extention version, we update `MINOR` when submodule is updated and `PATCH` when only build method is updated 126 | 127 | ## License 128 | 129 | This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details 130 | 131 | This is a derived work please see [VSCode's LICENSE.txt](https://github.com/Microsoft/vscode/blob/master/LICENSE.txt) for the original copyright and license. 132 | 133 | --------------------------------------------------------------------------------