vscode-css-languageservice
Advanced tools
Comparing version 4.4.0 to 5.0.0
@@ -0,1 +1,6 @@ | ||
5.0.0 / 2020-12-14 | ||
================== | ||
* Update to `vscode-languageserver-types@3.16` | ||
* Removed deprecated `findColorSymbols` | ||
4.4.0 - 2020-11-30 | ||
@@ -2,0 +7,0 @@ =================== |
@@ -24,6 +24,2 @@ import { LanguageSettings, ICompletionParticipant, DocumentContext, LanguageServiceOptions, Diagnostic, Position, CompletionList, Hover, Location, DocumentHighlight, DocumentLink, SymbolInformation, Range, CodeActionContext, Command, CodeAction, ColorInformation, Color, ColorPresentation, WorkspaceEdit, FoldingRange, SelectionRange, TextDocument, ICSSDataProvider, CSSDataV1, HoverSettings } from './cssLanguageTypes'; | ||
doCodeActions2(document: TextDocument, range: Range, context: CodeActionContext, stylesheet: Stylesheet): CodeAction[]; | ||
/** | ||
* @deprecated use findDocumentColors instead | ||
*/ | ||
findColorSymbols(document: TextDocument, stylesheet: Stylesheet): Range[]; | ||
findDocumentColors(document: TextDocument, stylesheet: Stylesheet): ColorInformation[]; | ||
@@ -30,0 +26,0 @@ getColorPresentations(document: TextDocument, stylesheet: Stylesheet, color: Color, range: Range): ColorPresentation[]; |
@@ -50,3 +50,2 @@ /*--------------------------------------------------------------------------------------------- | ||
doCodeActions2: codeActions.doCodeActions2.bind(codeActions), | ||
findColorSymbols: function (d, s) { return navigation.findDocumentColors(d, s).map(function (s) { return s.range; }); }, | ||
findDocumentColors: navigation.findDocumentColors.bind(navigation), | ||
@@ -53,0 +52,0 @@ getColorPresentations: navigation.getColorPresentations.bind(navigation), |
@@ -6,8 +6,8 @@ /*--------------------------------------------------------------------------------------------- | ||
'use strict'; | ||
import * as nls from 'vscode-nls'; | ||
import * as languageFacts from '../languageFacts/facts'; | ||
import * as nodes from '../parser/cssNodes'; | ||
import { union } from '../utils/arrays'; | ||
import { Rules, Settings } from './lintRules'; | ||
import * as nodes from '../parser/cssNodes'; | ||
import calculateBoxModel, { Element } from './lintUtil'; | ||
import { union } from '../utils/arrays'; | ||
import * as nls from 'vscode-nls'; | ||
var localize = nls.loadMessageBundle(); | ||
@@ -149,2 +149,4 @@ var NodesByRootMap = /** @class */ (function () { | ||
return this.visitPrio(node); | ||
case nodes.NodeType.IdentifierSelector: | ||
return this.visitIdentifierSelector(node); | ||
} | ||
@@ -205,15 +207,16 @@ return true; | ||
LintVisitor.prototype.visitSimpleSelector = function (node) { | ||
var firstChar = this.documentText.charAt(node.offset); | ||
///////////////////////////////////////////////////////////// | ||
// Lint - The universal selector (*) is known to be slow. | ||
///////////////////////////////////////////////////////////// | ||
var firstChar = this.documentText.charAt(node.offset); | ||
if (node.length === 1 && firstChar === '*') { | ||
this.addEntry(node, Rules.UniversalSelector); | ||
} | ||
return true; | ||
}; | ||
LintVisitor.prototype.visitIdentifierSelector = function (node) { | ||
///////////////////////////////////////////////////////////// | ||
// Lint - Avoid id selectors | ||
///////////////////////////////////////////////////////////// | ||
if (firstChar === '#') { | ||
this.addEntry(node, Rules.AvoidIdSelector); | ||
} | ||
this.addEntry(node, Rules.AvoidIdSelector); | ||
return true; | ||
@@ -220,0 +223,0 @@ }; |
@@ -24,6 +24,2 @@ import { LanguageSettings, ICompletionParticipant, DocumentContext, LanguageServiceOptions, Diagnostic, Position, CompletionList, Hover, Location, DocumentHighlight, DocumentLink, SymbolInformation, Range, CodeActionContext, Command, CodeAction, ColorInformation, Color, ColorPresentation, WorkspaceEdit, FoldingRange, SelectionRange, TextDocument, ICSSDataProvider, CSSDataV1, HoverSettings } from './cssLanguageTypes'; | ||
doCodeActions2(document: TextDocument, range: Range, context: CodeActionContext, stylesheet: Stylesheet): CodeAction[]; | ||
/** | ||
* @deprecated use findDocumentColors instead | ||
*/ | ||
findColorSymbols(document: TextDocument, stylesheet: Stylesheet): Range[]; | ||
findDocumentColors(document: TextDocument, stylesheet: Stylesheet): ColorInformation[]; | ||
@@ -30,0 +26,0 @@ getColorPresentations(document: TextDocument, stylesheet: Stylesheet, color: Color, range: Range): ColorPresentation[]; |
@@ -73,3 +73,2 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
doCodeActions2: codeActions.doCodeActions2.bind(codeActions), | ||
findColorSymbols: function (d, s) { return navigation.findDocumentColors(d, s).map(function (s) { return s.range; }); }, | ||
findDocumentColors: navigation.findDocumentColors.bind(navigation), | ||
@@ -76,0 +75,0 @@ getColorPresentations: navigation.getColorPresentations.bind(navigation), |
@@ -7,3 +7,3 @@ (function (factory) { | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "../languageFacts/facts", "./lintRules", "../parser/cssNodes", "./lintUtil", "../utils/arrays", "vscode-nls"], factory); | ||
define(["require", "exports", "vscode-nls", "../languageFacts/facts", "../parser/cssNodes", "../utils/arrays", "./lintRules", "./lintUtil"], factory); | ||
} | ||
@@ -18,8 +18,8 @@ })(function (require, exports) { | ||
exports.LintVisitor = void 0; | ||
var nls = require("vscode-nls"); | ||
var languageFacts = require("../languageFacts/facts"); | ||
var nodes = require("../parser/cssNodes"); | ||
var arrays_1 = require("../utils/arrays"); | ||
var lintRules_1 = require("./lintRules"); | ||
var nodes = require("../parser/cssNodes"); | ||
var lintUtil_1 = require("./lintUtil"); | ||
var arrays_1 = require("../utils/arrays"); | ||
var nls = require("vscode-nls"); | ||
var localize = nls.loadMessageBundle(); | ||
@@ -161,2 +161,4 @@ var NodesByRootMap = /** @class */ (function () { | ||
return this.visitPrio(node); | ||
case nodes.NodeType.IdentifierSelector: | ||
return this.visitIdentifierSelector(node); | ||
} | ||
@@ -217,15 +219,16 @@ return true; | ||
LintVisitor.prototype.visitSimpleSelector = function (node) { | ||
var firstChar = this.documentText.charAt(node.offset); | ||
///////////////////////////////////////////////////////////// | ||
// Lint - The universal selector (*) is known to be slow. | ||
///////////////////////////////////////////////////////////// | ||
var firstChar = this.documentText.charAt(node.offset); | ||
if (node.length === 1 && firstChar === '*') { | ||
this.addEntry(node, lintRules_1.Rules.UniversalSelector); | ||
} | ||
return true; | ||
}; | ||
LintVisitor.prototype.visitIdentifierSelector = function (node) { | ||
///////////////////////////////////////////////////////////// | ||
// Lint - Avoid id selectors | ||
///////////////////////////////////////////////////////////// | ||
if (firstChar === '#') { | ||
this.addEntry(node, lintRules_1.Rules.AvoidIdSelector); | ||
} | ||
this.addEntry(node, lintRules_1.Rules.AvoidIdSelector); | ||
return true; | ||
@@ -232,0 +235,0 @@ }; |
{ | ||
"name": "vscode-css-languageservice", | ||
"version": "4.4.0", | ||
"version": "5.0.0", | ||
"description": "Language service for CSS, LESS and SCSS", | ||
@@ -30,3 +30,3 @@ "main": "./lib/umd/cssLanguageService.js", | ||
"vscode-languageserver-textdocument": "^1.0.1", | ||
"vscode-languageserver-types": "3.16.0-next.2", | ||
"vscode-languageserver-types": "^3.16.0", | ||
"vscode-nls": "^5.0.0", | ||
@@ -33,0 +33,0 @@ "vscode-uri": "^2.1.2" |
2890625
68101
+ Addedvscode-languageserver-types@3.17.5(transitive)
- Removedvscode-languageserver-types@3.16.0-next.2(transitive)