Socket
Socket
Sign inDemoInstall

monaco-css

Package Overview
Dependencies
Maintainers
7
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

monaco-css - npm Package Compare versions

Comparing version 2.7.0 to 3.0.0

.prettierignore

2

LICENSE.md

@@ -21,2 +21,2 @@ The MIT License (MIT)

OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
{
"name": "monaco-css",
"version": "2.7.0",
"description": "CSS, LESS and SCSS plugin for the Monaco Editor",
"scripts": {
"compile": "mrmdir ./out && tsc -p ./src/tsconfig.json && tsc -p ./src/tsconfig.esm.json",
"watch": "tsc -p ./src --watch",
"prepublishOnly": "mrmdir ./release && npm run compile && node ./scripts/release.js && node ./scripts/bundle && mcopy ./src/monaco.d.ts ./release/monaco.d.ts",
"install-service-next": "npm install vscode-css-languageservice@next -f -D && npm install vscode-languageserver-types@next -f -D",
"install-service-local": "npm install ../vscode-css-languageservice -f -D && npm install ../vscode-languageserver-node/types -f -D"
},
"author": "Microsoft Corporation",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/monaco-css"
},
"bugs": {
"url": "https://github.com/Microsoft/monaco-css/issues"
},
"devDependencies": {
"monaco-editor-core": "0.20.0",
"monaco-languages": "1.10.0",
"monaco-plugin-helpers": "^1.0.2",
"requirejs": "^2.3.6",
"typescript": "3.7.5",
"terser": "^4.6.3",
"vscode-css-languageservice": "4.0.3-next.25",
"vscode-languageserver-types": "3.15.0-next.9",
"vscode-languageserver-textdocument": "^1.0.0-next.5"
}
"name": "monaco-css",
"version": "3.0.0",
"description": "CSS, LESS and SCSS plugin for the Monaco Editor",
"scripts": {
"compile": "mrmdir ./out && tsc -p ./src/tsconfig.json && tsc -p ./src/tsconfig.esm.json && node ./scripts/dts && prettier --write ./monaco.d.ts",
"watch": "tsc -p ./src --watch",
"prepublishOnly": "mrmdir ./release && npm run compile && node ./scripts/release.js && node ./scripts/bundle && mcopy ./monaco.d.ts ./release/monaco.d.ts && mcopy ./out/esm/monaco.contribution.d.ts ./release/esm/monaco.contribution.d.ts && mcopy ./out/esm/fillers/monaco-editor-core.d.ts ./release/esm/fillers/monaco-editor-core.d.ts",
"install-service-next": "npm install vscode-css-languageservice@next -f -D && npm install vscode-languageserver-types@next -f -D",
"install-service-local": "npm install ../vscode-css-languageservice -f -D && npm install ../vscode-languageserver-node/types -f -D",
"prettier": "prettier --write ."
},
"author": "Microsoft Corporation",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/monaco-css"
},
"bugs": {
"url": "https://github.com/Microsoft/monaco-css/issues"
},
"module": "./release/esm/monaco.contribution.js",
"typings": "./release/esm/monaco.contribution.d.ts",
"devDependencies": {
"husky": "^4.3.0",
"monaco-editor-core": "0.20.0",
"monaco-languages": "1.10.0",
"monaco-plugin-helpers": "^1.0.3",
"prettier": "^2.1.1",
"pretty-quick": "^3.0.0",
"requirejs": "^2.3.6",
"typescript": "4.0.2",
"terser": "^5.3.0",
"vscode-css-languageservice": "4.3.3",
"vscode-languageserver-types": "3.15.1",
"vscode-languageserver-textdocument": "^1.0.1"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
}
}
# Monaco CSS
CSS language plugin for the Monaco Editor. It provides the following features when editing CSS, LESS and SCSS files:
* Code completion
* Hovers
* Validation: Syntax errors and linting
* Find definition, references & highlights for symbols in the same file
* Document Symbols
* Color Decorators
- Code completion
- Hovers
- Validation: Syntax errors and linting
- Find definition, references & highlights for symbols in the same file
- Document Symbols
- Color Decorators
Linting an be configured through the API. See [here](https://github.com/Microsoft/monaco-css/blob/master/src/monaco.d.ts) for the API that the

@@ -28,9 +29,10 @@ CSS plugin offers to configure the CSS/LESS/SCSS language support.

* `npm install .`
* compile with `npm run compile`
* watch with `npm run watch`
* `npm run prepublishOnly`
* open `$/monaco-css/test/index.html` in your favorite browser.
- `npm install .`
- compile with `npm run compile`
- watch with `npm run watch`
- `npm run prepublishOnly`
- open `$/monaco-css/test/index.html` in your favorite browser.
## License
[MIT](https://github.com/Microsoft/monaco-css/blob/master/LICENSE.md)

@@ -1,13 +0,21 @@

define('vs/language/css/monaco.contribution',["require", "exports"], function (require, exports) {
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
define('vs/language/css/fillers/monaco-editor-core',[], function () {
return self.monaco;
});
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
define('vs/language/css/monaco.contribution',["require", "exports", "./fillers/monaco-editor-core"], function (require, exports, monaco_editor_core_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Emitter = monaco.Emitter;
exports.lessDefaults = exports.scssDefaults = exports.cssDefaults = void 0;
// --- CSS configuration and defaults ---------
var LanguageServiceDefaultsImpl = /** @class */ (function () {
function LanguageServiceDefaultsImpl(languageId, diagnosticsOptions, modeConfiguration) {
this._onDidChange = new Emitter();
this._onDidChange = new monaco_editor_core_1.Emitter();
this._languageId = languageId;

@@ -21,3 +29,3 @@ this.setDiagnosticsOptions(diagnosticsOptions);

},
enumerable: true,
enumerable: false,
configurable: true

@@ -29,3 +37,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -37,3 +45,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -45,3 +53,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -57,6 +65,4 @@ });

};
;
return LanguageServiceDefaultsImpl;
}());
exports.LanguageServiceDefaultsImpl = LanguageServiceDefaultsImpl;
var diagnosticDefault = {

@@ -98,14 +104,7 @@ validate: true,

};
var cssDefaults = new LanguageServiceDefaultsImpl('css', diagnosticDefault, modeConfigurationDefault);
var scssDefaults = new LanguageServiceDefaultsImpl('scss', diagnosticDefault, modeConfigurationDefault);
var lessDefaults = new LanguageServiceDefaultsImpl('less', diagnosticDefault, modeConfigurationDefault);
// Export API
function createAPI() {
return {
cssDefaults: cssDefaults,
lessDefaults: lessDefaults,
scssDefaults: scssDefaults
};
}
monaco.languages.css = createAPI();
exports.cssDefaults = new LanguageServiceDefaultsImpl('css', diagnosticDefault, modeConfigurationDefault);
exports.scssDefaults = new LanguageServiceDefaultsImpl('scss', diagnosticDefault, modeConfigurationDefault);
exports.lessDefaults = new LanguageServiceDefaultsImpl('less', diagnosticDefault, modeConfigurationDefault);
// export to the global based API
monaco_editor_core_1.languages.json = { cssDefaults: exports.cssDefaults, lessDefaults: exports.lessDefaults, scssDefaults: exports.scssDefaults };
// --- Registration to monaco editor ---

@@ -115,12 +114,12 @@ function getMode() {

}
monaco.languages.onLanguage('less', function () {
getMode().then(function (mode) { return mode.setupMode(lessDefaults); });
monaco_editor_core_1.languages.onLanguage('less', function () {
getMode().then(function (mode) { return mode.setupMode(exports.lessDefaults); });
});
monaco.languages.onLanguage('scss', function () {
getMode().then(function (mode) { return mode.setupMode(scssDefaults); });
monaco_editor_core_1.languages.onLanguage('scss', function () {
getMode().then(function (mode) { return mode.setupMode(exports.scssDefaults); });
});
monaco.languages.onLanguage('css', function () {
getMode().then(function (mode) { return mode.setupMode(cssDefaults); });
monaco_editor_core_1.languages.onLanguage('css', function () {
getMode().then(function (mode) { return mode.setupMode(exports.cssDefaults); });
});
});

@@ -17,7 +17,15 @@ /*---------------------------------------------------------------------------------------------

import { getFoldingRanges } from './services/cssFolding';
import { cssDataManager } from './languageFacts/facts';
import { CSSDataManager } from './languageFacts/dataManager';
import { CSSDataProvider } from './languageFacts/dataProvider';
import { getSelectionRanges } from './services/cssSelectionRange';
import { SCSSNavigation } from './services/scssNavigation';
import { cssData } from './data/webCustomData';
export * from './cssLanguageTypes';
function createFacade(parser, completion, hover, navigation, codeActions, validation) {
export function getDefaultCSSDataProvider() {
return newCSSDataProvider(cssData);
}
export function newCSSDataProvider(data) {
return new CSSDataProvider(data);
}
function createFacade(parser, completion, hover, navigation, codeActions, validation, cssDataManager) {
return {

@@ -28,5 +36,7 @@ configure: function (settings) {

},
setDataProviders: cssDataManager.setDataProviders.bind(cssDataManager),
doValidation: validation.doValidation.bind(validation),
parseStylesheet: parser.parseStylesheet.bind(parser),
doComplete: completion.doComplete.bind(completion),
doComplete2: completion.doComplete2.bind(completion),
setCompletionParticipants: completion.setCompletionParticipants.bind(completion),

@@ -50,18 +60,17 @@ doHover: hover.doHover.bind(hover),

}
function handleCustomData(options) {
if (options && options.customDataProviders) {
cssDataManager.addDataProviders(options.customDataProviders);
}
}
var defaultLanguageServiceOptions = {};
export function getCSSLanguageService(options) {
handleCustomData(options);
return createFacade(new Parser(), new CSSCompletion(null, options && options.clientCapabilities), new CSSHover(options && options.clientCapabilities), new CSSNavigation(), new CSSCodeActions(), new CSSValidation());
if (options === void 0) { options = defaultLanguageServiceOptions; }
var cssDataManager = new CSSDataManager(options);
return createFacade(new Parser(), new CSSCompletion(null, options, cssDataManager), new CSSHover(options && options.clientCapabilities, cssDataManager), new CSSNavigation(options && options.fileSystemProvider), new CSSCodeActions(cssDataManager), new CSSValidation(cssDataManager), cssDataManager);
}
export function getSCSSLanguageService(options) {
handleCustomData(options);
return createFacade(new SCSSParser(), new SCSSCompletion(options && options.clientCapabilities), new CSSHover(options && options.clientCapabilities), new SCSSNavigation(options && options.fileSystemProvider), new CSSCodeActions(), new CSSValidation());
if (options === void 0) { options = defaultLanguageServiceOptions; }
var cssDataManager = new CSSDataManager(options);
return createFacade(new SCSSParser(), new SCSSCompletion(options, cssDataManager), new CSSHover(options && options.clientCapabilities, cssDataManager), new SCSSNavigation(options && options.fileSystemProvider), new CSSCodeActions(cssDataManager), new CSSValidation(cssDataManager), cssDataManager);
}
export function getLESSLanguageService(options) {
handleCustomData(options);
return createFacade(new LESSParser(), new LESSCompletion(options && options.clientCapabilities), new CSSHover(options && options.clientCapabilities), new CSSNavigation(), new CSSCodeActions(), new CSSValidation());
if (options === void 0) { options = defaultLanguageServiceOptions; }
var cssDataManager = new CSSDataManager(options);
return createFacade(new LESSParser(), new LESSCompletion(options, cssDataManager), new CSSHover(options && options.clientCapabilities, cssDataManager), new CSSNavigation(options && options.fileSystemProvider), new CSSCodeActions(cssDataManager), new CSSValidation(cssDataManager), cssDataManager);
}

@@ -6,5 +6,5 @@ /*---------------------------------------------------------------------------------------------

'use strict';
import { MarkupKind } from './../vscode-languageserver-types/main';
export { TextDocument } from './_deps/vscode-languageserver-textdocument/lib/esm/main';
export * from './../vscode-languageserver-types/main';
import { MarkupKind } from './_deps/vscode-languageserver-types/main';
export { TextDocument } from '../vscode-languageserver-textdocument/lib/esm/main';
export * from './_deps/vscode-languageserver-types/main';
export var ClientCapabilities;

@@ -11,0 +11,0 @@ (function (ClientCapabilities) {

@@ -6,3 +6,3 @@ /*---------------------------------------------------------------------------------------------

import * as nodes from '../parser/cssNodes';
import * as nls from './../../../fillers/vscode-nls';
import * as nls from '../../../fillers/vscode-nls';
var localize = nls.loadMessageBundle();

@@ -9,0 +9,0 @@ export var colorFunctions = [

@@ -7,5 +7,7 @@ /*---------------------------------------------------------------------------------------------

import * as objects from '../utils/objects';
import { cssData } from '../data/webCustomData';
import { CSSDataProvider } from './dataProvider';
var CSSDataManager = /** @class */ (function () {
function CSSDataManager(dataProviders) {
this.dataProviders = dataProviders;
function CSSDataManager(options) {
this.dataProviders = [];
this._propertySet = {};

@@ -19,6 +21,11 @@ this._atDirectiveSet = {};

this._pseudoElements = [];
this.collectData();
this.setDataProviders((options === null || options === void 0 ? void 0 : options.useDefaultDataProvider) !== false, (options === null || options === void 0 ? void 0 : options.customDataProviders) || []);
}
CSSDataManager.prototype.addDataProviders = function (providers) {
this.dataProviders = this.dataProviders.concat(providers);
CSSDataManager.prototype.setDataProviders = function (builtIn, providers) {
var _a;
this.dataProviders = [];
if (builtIn) {
this.dataProviders.push(new CSSDataProvider(cssData));
}
(_a = this.dataProviders).push.apply(_a, providers);
this.collectData();

@@ -31,2 +38,6 @@ };

var _this = this;
this._propertySet = {};
this._atDirectiveSet = {};
this._pseudoClassSet = {};
this._pseudoElementSet = {};
this.dataProviders.forEach(function (provider) {

@@ -33,0 +44,0 @@ provider.provideProperties().forEach(function (p) {

@@ -32,13 +32,33 @@ /*---------------------------------------------------------------------------------------------

CSSDataProvider.prototype.addData = function (data) {
if (data.properties) {
this._properties = this._properties.concat(data.properties);
if (Array.isArray(data.properties)) {
for (var _i = 0, _a = data.properties; _i < _a.length; _i++) {
var prop = _a[_i];
if (isPropertyData(prop)) {
this._properties.push(prop);
}
}
}
if (data.atDirectives) {
this._atDirectives = this._atDirectives.concat(data.atDirectives);
if (Array.isArray(data.atDirectives)) {
for (var _b = 0, _c = data.atDirectives; _b < _c.length; _b++) {
var prop = _c[_b];
if (isAtDirective(prop)) {
this._atDirectives.push(prop);
}
}
}
if (data.pseudoClasses) {
this._pseudoClasses = this._pseudoClasses.concat(data.pseudoClasses);
if (Array.isArray(data.pseudoClasses)) {
for (var _d = 0, _e = data.pseudoClasses; _d < _e.length; _d++) {
var prop = _e[_d];
if (isPseudoClassData(prop)) {
this._pseudoClasses.push(prop);
}
}
}
if (data.pseudoElements) {
this._pseudoElements = this._pseudoElements.concat(data.pseudoElements);
if (Array.isArray(data.pseudoElements)) {
for (var _f = 0, _g = data.pseudoElements; _f < _g.length; _f++) {
var prop = _g[_f];
if (isPseudoElementData(prop)) {
this._pseudoElements.push(prop);
}
}
}

@@ -49,1 +69,13 @@ };

export { CSSDataProvider };
function isPropertyData(d) {
return typeof d.name === 'string';
}
function isAtDirective(d) {
return typeof d.name === 'string';
}
function isPseudoClassData(d) {
return typeof d.name === 'string';
}
function isPseudoElementData(d) {
return typeof d.name === 'string';
}

@@ -27,4 +27,5 @@ /*---------------------------------------------------------------------------------------------

export function getEntryDescription(entry, doesSupportMarkdown) {
var result;
if (doesSupportMarkdown) {
return {
result = {
kind: 'markdown',

@@ -35,3 +36,3 @@ value: getEntryMarkdownDescription(entry)

else {
return {
result = {
kind: 'plaintext',

@@ -41,3 +42,11 @@ value: getEntryStringDescription(entry)

}
if (result.value === '') {
return undefined;
}
return result;
}
export function textToMarkedString(text) {
text = text.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash
return text.replace(/</g, '&lt;').replace(/>/g, '&gt;');
}
function getEntryStringDescription(entry) {

@@ -78,14 +87,10 @@ if (!entry.description || entry.description === '') {

}
if (typeof entry.description === 'string') {
result += entry.description;
}
else {
result = entry.description.value;
}
var description = typeof entry.description === 'string' ? entry.description : entry.description.value;
result += textToMarkedString(description);
var browserLabel = getBrowserLabel(entry.browsers);
if (browserLabel) {
result += '\n\n(' + browserLabel + ')';
result += '\n\n(' + textToMarkedString(browserLabel) + ')';
}
if ('syntax' in entry) {
result += "\n\nSyntax: " + entry.syntax;
if ('syntax' in entry && entry.syntax) {
result += "\n\nSyntax: " + textToMarkedString(entry.syntax);
}

@@ -92,0 +97,0 @@ if (entry.references && entry.references.length > 0) {

@@ -6,12 +6,4 @@ /*---------------------------------------------------------------------------------------------

'use strict';
import * as webCustomData from '../data/webCustomData';
import { CSSDataManager } from './dataManager';
import { CSSDataProvider } from './dataProvider';
export * from './entry';
export * from './colors';
export * from './builtinData';
export * from './dataProvider';
export * from './dataManager';
export var cssDataManager = new CSSDataManager([
new CSSDataProvider(webCustomData.cssData)
]);

@@ -6,3 +6,3 @@ /*---------------------------------------------------------------------------------------------

'use strict';
import * as nls from './../../../fillers/vscode-nls';
import * as nls from '../../../fillers/vscode-nls';
var localize = nls.loadMessageBundle();

@@ -9,0 +9,0 @@ var CSSIssueType = /** @class */ (function () {

@@ -306,9 +306,14 @@ /*---------------------------------------------------------------------------------------------

};
Parser.prototype._parseRuleSetDeclaration = function () {
// https://www.w3.org/TR/css-syntax-3/#consume-a-list-of-declarations0
Parser.prototype._parseRuleSetDeclarationAtStatement = function () {
return this._parseAtApply()
|| this._tryParseCustomPropertyDeclaration()
|| this._parseDeclaration()
|| this._parseUnknownAtRule();
};
Parser.prototype._parseRuleSetDeclaration = function () {
// https://www.w3.org/TR/css-syntax-3/#consume-a-list-of-declarations0
if (this.peek(TokenType.AtKeyword)) {
return this._parseRuleSetDeclarationAtStatement();
}
return this._tryParseCustomPropertyDeclaration()
|| this._parseDeclaration();
};
/**

@@ -344,5 +349,6 @@ * Parses declarations like:

case nodes.NodeType.FunctionDeclaration:
case nodes.NodeType.MixinContentDeclaration:
return false;
case nodes.NodeType.ExtendsReference:
case nodes.NodeType.MixinContent:
case nodes.NodeType.MixinContentReference:
case nodes.NodeType.ReturnStatement:

@@ -1307,10 +1313,3 @@ case nodes.NodeType.MediaQuery:

node.setOperator(this._parseUnaryOperator()); // optional
if (node.setExpression(this._parseURILiteral()) || // url before function
node.setExpression(this._parseFunction()) || // function before ident
node.setExpression(this._parseIdent()) ||
node.setExpression(this._parseStringLiteral()) ||
node.setExpression(this._parseNumeric()) ||
node.setExpression(this._parseHexColor()) ||
node.setExpression(this._parseOperation()) ||
node.setExpression(this._parseNamedLine())) {
if (node.setExpression(this._parseTermExpression())) {
return this.finish(node);

@@ -1320,2 +1319,12 @@ }

};
Parser.prototype._parseTermExpression = function () {
return this._parseURILiteral() || // url before function
this._parseFunction() || // function before ident
this._parseIdent() ||
this._parseStringLiteral() ||
this._parseNumeric() ||
this._parseHexColor() ||
this._parseOperation() ||
this._parseNamedLine();
};
Parser.prototype._parseOperation = function () {

@@ -1322,0 +1331,0 @@ if (!this.peek(TokenType.ParenthesisL)) {

@@ -341,19 +341,2 @@ /*---------------------------------------------------------------------------------------------

};
Scanner.prototype._matchWordAnyCase = function (characters) {
var index = 0;
this.stream.advanceWhileChar(function (ch) {
var result = characters[index] === ch || characters[index + 1] === ch;
if (result) {
index += 2;
}
return result;
});
if (index === characters.length) {
return true;
}
else {
this.stream.goBack(index / 2);
return false;
}
};
Scanner.prototype.trivia = function () {

@@ -360,0 +343,0 @@ while (true) {

@@ -233,14 +233,7 @@ /*---------------------------------------------------------------------------------------------

};
LESSParser.prototype._parseTerm = function () {
var term = _super.prototype._parseTerm.call(this);
if (term) {
return term;
}
term = this.create(nodes.Term);
if (term.setExpression(this._parseVariable()) ||
term.setExpression(this._parseEscaped()) ||
term.setExpression(this._tryParseMixinReference(false))) {
return this.finish(term);
}
return null;
LESSParser.prototype._parseTermExpression = function () {
return this._parseVariable() ||
this._parseEscaped() ||
_super.prototype._parseTermExpression.call(this) || // preference for colors before mixin references
this._tryParseMixinReference(false);
};

@@ -304,3 +297,3 @@ LESSParser.prototype._parseEscaped = function () {

|| this._parseVariableDeclaration() // Variable declarations
|| this._parseUnknownAtRule();
|| _super.prototype._parseRuleSetDeclarationAtStatement.call(this);
}

@@ -586,3 +579,3 @@ return this._tryParseMixinDeclaration()

var hasArguments = false;
if (!this.hasWhitespace() && this.accept(TokenType.ParenthesisL)) {
if (this.accept(TokenType.ParenthesisL)) {
hasArguments = true;

@@ -589,0 +582,0 @@ if (node.getArguments().addChild(this._parseMixinArgument())) {

@@ -6,3 +6,3 @@ /*---------------------------------------------------------------------------------------------

'use strict';
import * as nls from './../../../fillers/vscode-nls';
import * as nls from '../../../fillers/vscode-nls';
var localize = nls.loadMessageBundle();

@@ -9,0 +9,0 @@ var SCSSIssueType = /** @class */ (function () {

@@ -34,16 +34,15 @@ /*---------------------------------------------------------------------------------------------

}
SCSSParser.prototype._parseStylesheetStart = function () {
return this._parseForward()
|| this._parseUse()
|| _super.prototype._parseStylesheetStart.call(this);
};
SCSSParser.prototype._parseStylesheetStatement = function () {
SCSSParser.prototype._parseStylesheetStatement = function (isNested) {
if (isNested === void 0) { isNested = false; }
if (this.peek(TokenType.AtKeyword)) {
return this._parseWarnAndDebug()
|| this._parseControlStatement()
|| this._parseMixinDeclaration()
|| this._parseMixinContent()
return this._parseWarnAndDebug() // @warn, @debug and @error statements
|| this._parseControlStatement() // @if, @while, @for, @each
|| this._parseMixinDeclaration() // @mixin
|| this._parseMixinContent() // @content
|| this._parseMixinReference() // @include
|| this._parseFunctionDeclaration()
|| _super.prototype._parseStylesheetAtStatement.call(this);
|| this._parseFunctionDeclaration() // @function
|| this._parseForward() // @forward
|| this._parseUse() // @use
|| this._parseRuleset(isNested) // @at-rule
|| _super.prototype._parseStylesheetAtStatement.call(this, isNested);
}

@@ -90,7 +89,13 @@ return this._parseRuleset(true) || this._parseVariableDeclaration();

}
while (this.accept(TokenType.Exclamation)) {
if (!this.peekRegExp(TokenType.Ident, /^(default|global)$/)) {
return this.finish(node, ParseError.UnknownKeyword);
while (this.peek(TokenType.Exclamation)) {
if (node.addChild(this._tryParsePrio())) {
// !important
}
this.consumeToken();
else {
this.consumeToken();
if (!this.peekRegExp(TokenType.Ident, /^(default|global)$/)) {
return this.finish(node, ParseError.UnknownKeyword);
}
this.consumeToken();
}
}

@@ -164,3 +169,3 @@ if (this.peek(TokenType.SemiColon)) {

};
while (this.accept(TokenType.Ident) || node.addChild(indentInterpolation()) || (hasContent && (this.acceptDelim('-') || this.accept(TokenType.Num)))) {
while (this.accept(TokenType.Ident) || node.addChild(indentInterpolation()) || (hasContent && this.acceptRegexp(/[\w-]/))) {
hasContent = true;

@@ -173,17 +178,8 @@ if (this.hasWhitespace()) {

};
SCSSParser.prototype._parseTerm = function () {
var term = this.create(nodes.Term);
if (term.setExpression(this._parseModuleMember())) {
return this.finish(term);
}
var superTerm = _super.prototype._parseTerm.call(this);
if (superTerm) {
return superTerm;
}
if (term.setExpression(this._parseVariable())
|| term.setExpression(this._parseSelectorCombinator())
|| term.setExpression(this._tryParsePrio())) {
return this.finish(term);
}
return null;
SCSSParser.prototype._parseTermExpression = function () {
return this._parseModuleMember() ||
this._parseVariable() ||
this._parseSelectorCombinator() ||
//this._tryParsePrio() ||
_super.prototype._parseTermExpression.call(this);
};

@@ -241,3 +237,4 @@ SCSSParser.prototype._parseInterpolation = function () {

|| this._parseRuleset(true) // @at-rule
|| this._parseSupports(true); // @supports
|| this._parseSupports(true) // @supports
|| _super.prototype._parseRuleSetDeclarationAtStatement.call(this);
}

@@ -529,4 +526,19 @@ return this._parseVariableDeclaration() // variable declaration

}
var node = this.createNode(nodes.NodeType.MixinContent);
var node = this.create(nodes.MixinContentReference);
this.consumeToken();
if (this.accept(TokenType.ParenthesisL)) {
if (node.getArguments().addChild(this._parseFunctionArgument())) {
while (this.accept(TokenType.Comma)) {
if (this.peek(TokenType.ParenthesisR)) {
break;
}
if (!node.getArguments().addChild(this._parseFunctionArgument())) {
return this.finish(node, ParseError.ExpressionExpected);
}
}
}
if (!this.accept(TokenType.ParenthesisR)) {
return this.finish(node, ParseError.RightParenthesisExpected);
}
}
return this.finish(node);

@@ -574,6 +586,29 @@ };

}
if (this.peekIdent('using') || this.peek(TokenType.CurlyL)) {
node.setContent(this._parseMixinContentDeclaration());
}
return this.finish(node);
};
SCSSParser.prototype._parseMixinContentDeclaration = function () {
var node = this.create(nodes.MixinContentDeclaration);
if (this.acceptIdent('using')) {
if (!this.accept(TokenType.ParenthesisL)) {
return this.finish(node, ParseError.LeftParenthesisExpected, [TokenType.CurlyL]);
}
if (node.getParameters().addChild(this._parseParameterDeclaration())) {
while (this.accept(TokenType.Comma)) {
if (this.peek(TokenType.ParenthesisR)) {
break;
}
if (!node.getParameters().addChild(this._parseParameterDeclaration())) {
return this.finish(node, ParseError.VariableNameExpected);
}
}
}
if (!this.accept(TokenType.ParenthesisR)) {
return this.finish(node, ParseError.RightParenthesisExpected, [TokenType.CurlyL]);
}
}
if (this.peek(TokenType.CurlyL)) {
var content = this.create(nodes.BodyDeclaration);
this._parseBody(content, this._parseMixinReferenceBodyStatement.bind(this));
node.setContent(content);
this._parseBody(node, this._parseMixinReferenceBodyStatement.bind(this));
}

@@ -609,2 +644,5 @@ return this.finish(node);

}
else if (node.setValue(this._tryParsePrio())) {
return this.finish(node);
}
return null;

@@ -655,7 +693,7 @@ };

SCSSParser.prototype._parseUse = function () {
if (!this.peek(scssScanner.Use)) {
if (!this.peekKeyword('@use')) {
return null;
}
var node = this.create(nodes.Use);
this.consumeToken();
this.consumeToken(); // @use
if (!node.addChild(this._parseStringLiteral())) {

@@ -709,3 +747,3 @@ return this.finish(node, ParseError.StringLiteralExpected);

SCSSParser.prototype._parseForward = function () {
if (!this.peek(scssScanner.Forward)) {
if (!this.peekKeyword('@forward')) {
return null;

@@ -753,4 +791,7 @@ }

};
SCSSParser.prototype._parseSupportsCondition = function () {
return this._parseInterpolation() || _super.prototype._parseSupportsCondition.call(this);
};
return SCSSParser;
}(cssParser.Parser));
export { SCSSParser };

@@ -43,4 +43,2 @@ /*---------------------------------------------------------------------------------------------

export var Module = customTokenValue++;
export var Forward = customTokenValue++;
export var Use = customTokenValue++;
var SCSSScanner = /** @class */ (function (_super) {

@@ -92,16 +90,2 @@ __extends(SCSSScanner, _super);

}
// module loaders, @forward and @use
if (this.stream.advanceIfChar(_ATS)) {
var content = ['@'];
if (this.ident(content)) {
var keywordText = content.join('');
if (keywordText === '@forward') {
return this.finishToken(offset, Forward, keywordText);
}
else if (keywordText === '@use') {
return this.finishToken(offset, Use, keywordText);
}
}
this.stream.goBackTo(offset);
}
return _super.prototype.scanNext.call(this, offset);

@@ -108,0 +92,0 @@ };

@@ -7,10 +7,10 @@ /*---------------------------------------------------------------------------------------------

import * as nodes from '../parser/cssNodes';
import * as languageFacts from '../languageFacts/facts';
import { difference } from '../utils/strings';
import { Rules } from '../services/lintRules';
import { Command, TextEdit, CodeAction, CodeActionKind, TextDocumentEdit, VersionedTextDocumentIdentifier } from '../cssLanguageTypes';
import * as nls from './../../../fillers/vscode-nls';
import * as nls from '../../../fillers/vscode-nls';
var localize = nls.loadMessageBundle();
var CSSCodeActions = /** @class */ (function () {
function CSSCodeActions() {
function CSSCodeActions(cssDataManager) {
this.cssDataManager = cssDataManager;
}

@@ -36,3 +36,3 @@ CSSCodeActions.prototype.doCodeActions = function (document, range, context, stylesheet) {

var candidates = [];
languageFacts.cssDataManager.getProperties().forEach(function (p) {
this.cssDataManager.getProperties().forEach(function (p) {
var score = difference(propertyName, p.name);

@@ -45,3 +45,3 @@ if (score >= propertyName.length / 2 /*score_lim*/) {

candidates.sort(function (a, b) {
return b.score - a.score;
return b.score - a.score || a.property.localeCompare(b.property);
});

@@ -48,0 +48,0 @@ var maxActions = 3;

@@ -6,2 +6,38 @@ /*---------------------------------------------------------------------------------------------

'use strict';
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
import * as nodes from '../parser/cssNodes';

@@ -12,4 +48,5 @@ import { Symbols } from '../parser/cssSymbolScope';

import { Position, CompletionItemKind, Range, TextEdit, InsertTextFormat, MarkupKind, CompletionItemTag } from '../cssLanguageTypes';
import * as nls from './../../../fillers/vscode-nls';
import * as nls from '../../../fillers/vscode-nls';
import { isDefined } from '../utils/objects';
import { PathCompletionParticipant } from './pathCompletion';
var localize = nls.loadMessageBundle();

@@ -27,11 +64,8 @@ var SnippetFormat = InsertTextFormat.Snippet;

var CSSCompletion = /** @class */ (function () {
function CSSCompletion(variablePrefix, clientCapabilities) {
function CSSCompletion(variablePrefix, lsOptions, cssDataManager) {
if (variablePrefix === void 0) { variablePrefix = null; }
this.variablePrefix = variablePrefix;
this.clientCapabilities = clientCapabilities;
this.lsOptions = lsOptions;
this.cssDataManager = cssDataManager;
this.completionParticipants = [];
this.valueTypes = [
nodes.NodeType.Identifier, nodes.NodeType.Value, nodes.NodeType.StringLiteral, nodes.NodeType.URILiteral, nodes.NodeType.NumericValue,
nodes.NodeType.HexColorValue, nodes.NodeType.VariableName, nodes.NodeType.Prio
];
}

@@ -50,2 +84,33 @@ CSSCompletion.prototype.configure = function (settings) {

};
CSSCompletion.prototype.doComplete2 = function (document, position, styleSheet, documentContext) {
return __awaiter(this, void 0, void 0, function () {
var participant, contributedParticipants, result, pathCompletionResult;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!this.lsOptions.fileSystemProvider || !this.lsOptions.fileSystemProvider.readDirectory) {
return [2 /*return*/, this.doComplete(document, position, styleSheet)];
}
participant = new PathCompletionParticipant(this.lsOptions.fileSystemProvider.readDirectory);
contributedParticipants = this.completionParticipants;
this.completionParticipants = [participant].concat(contributedParticipants);
result = this.doComplete(document, position, styleSheet);
_a.label = 1;
case 1:
_a.trys.push([1, , 3, 4]);
return [4 /*yield*/, participant.computeCompletions(document, documentContext)];
case 2:
pathCompletionResult = _a.sent();
return [2 /*return*/, {
isIncomplete: result.isIncomplete || pathCompletionResult.isIncomplete,
items: pathCompletionResult.items.concat(result.items)
}];
case 3:
this.completionParticipants = contributedParticipants;
return [7 /*endfinally*/];
case 4: return [2 /*return*/];
}
});
});
};
CSSCompletion.prototype.doComplete = function (document, position, styleSheet) {

@@ -160,23 +225,2 @@ this.offset = document.offsetAt(position);

CSSCompletion.prototype.finalize = function (result) {
var needsSortText = result.items.some(function (i) { return !!i.sortText || i.label[0] === '-'; });
if (needsSortText) {
result.items.forEach(function (item, index) {
if (!item.sortText) {
if (item.label[0] === '-') {
item.sortText = SortTexts.VendorPrefixed + '_' + computeRankNumber(index);
}
else {
item.sortText = SortTexts.Normal + '_' + computeRankNumber(index);
}
}
else {
if (item.label[0] === '-') {
item.sortText += SortTexts.VendorPrefixed + '_' + computeRankNumber(index);
}
else {
item.sortText += SortTexts.Normal + '_' + computeRankNumber(index);
}
}
});
}
return result;

@@ -204,3 +248,3 @@ };

var completePropertyWithSemicolon = this.isCompletePropertyWithSemicolonEnabled;
var properties = languageFacts.cssDataManager.getProperties();
var properties = this.cssDataManager.getProperties();
properties.forEach(function (entry) {

@@ -250,5 +294,6 @@ var range;

}
if (strings.startsWith(entry.name, '-')) {
item.sortText = SortTexts.VendorPrefixed;
}
var relevance = typeof entry.relevance === 'number' ? Math.min(Math.max(entry.relevance, 0), 99) : 50;
var sortTextSuffix = (255 - relevance).toString(16);
var sortTextPrefix = strings.startsWith(entry.name, '-') ? SortTexts.VendorPrefixed : SortTexts.Normal;
item.sortText = sortTextPrefix + '_' + sortTextSuffix;
result.items.push(item);

@@ -293,3 +338,3 @@ });

var propertyName = node.getFullPropertyName();
var entry = languageFacts.cssDataManager.getProperty(propertyName);
var entry = this.cssDataManager.getProperty(propertyName);
var existingNode = node.getValue() || null;

@@ -378,2 +423,6 @@ while (existingNode && existingNode.hasChildren()) {

}
var sortText = SortTexts.Enums;
if (strings.startsWith(value.name, '-')) {
sortText += SortTexts.VendorPrefixed;
}
var item = {

@@ -384,3 +433,3 @@ label: value.name,

textEdit: TextEdit.replace(this.getCompletionRange(existingNode), insertString),
sortText: SortTexts.Enums,
sortText: sortText,
kind: CompletionItemKind.Value,

@@ -667,3 +716,3 @@ insertTextFormat: insertTextFormat

var _this = this;
languageFacts.cssDataManager.getAtDirectives().forEach(function (entry) {
this.cssDataManager.getAtDirectives().forEach(function (entry) {
result.items.push({

@@ -700,3 +749,3 @@ label: entry.name,

}
var pseudoClasses = languageFacts.cssDataManager.getPseudoClasses();
var pseudoClasses = this.cssDataManager.getPseudoClasses();
pseudoClasses.forEach(function (entry) {

@@ -717,3 +766,3 @@ var insertText = moveCursorInsideParenthesis(entry.name);

});
var pseudoElements = languageFacts.cssDataManager.getPseudoElements();
var pseudoElements = this.cssDataManager.getPseudoElements();
pseudoElements.forEach(function (entry) {

@@ -810,2 +859,5 @@ var insertText = moveCursorInsideParenthesis(entry.name);

}
else if (node instanceof nodes.RuleSet) {
this.getCompletionsForDeclarationProperty(null, result);
}
return result;

@@ -827,3 +879,3 @@ };

if (!declaration) {
this.getTermProposals(null, null, result);
this.getTermProposals(undefined, null, result);
return result;

@@ -852,3 +904,3 @@ }

if (declarations && this.offset > declarations.offset && this.offset < declarations.end) {
this.getTermProposals(null, null, result);
this.getTermProposals(undefined, null, result);
}

@@ -858,2 +910,3 @@ return result;

CSSCompletion.prototype.getCompletionsForMixinReference = function (ref, result) {
var _this = this;
var allMixins = this.getSymbolContext().findSymbolsAtOffset(this.offset, nodes.ReferenceType.Mixin);

@@ -866,2 +919,11 @@ for (var _i = 0, allMixins_1 = allMixins; _i < allMixins_1.length; _i++) {

}
var identifierNode = ref.getIdentifier() || null;
this.completionParticipants.forEach(function (participant) {
if (participant.onCssMixinReference) {
participant.onCssMixinReference({
mixinName: _this.currentWord,
range: _this.getCompletionRange(identifierNode)
});
}
});
return result;

@@ -971,9 +1033,10 @@ };

CSSCompletion.prototype.doesSupportMarkdown = function () {
var _a, _b, _c;
if (!isDefined(this.supportsMarkdown)) {
if (!isDefined(this.clientCapabilities)) {
if (!isDefined(this.lsOptions.clientCapabilities)) {
this.supportsMarkdown = true;
return this.supportsMarkdown;
}
var completion = this.clientCapabilities.textDocument && this.clientCapabilities.textDocument.completion;
this.supportsMarkdown = completion && completion.completionItem && Array.isArray(completion.completionItem.documentationFormat) && completion.completionItem.documentationFormat.indexOf(MarkupKind.Markdown) !== -1;
var documentationFormat = (_c = (_b = (_a = this.lsOptions.clientCapabilities.textDocument) === null || _a === void 0 ? void 0 : _a.completion) === null || _b === void 0 ? void 0 : _b.completionItem) === null || _c === void 0 ? void 0 : _c.documentationFormat;
this.supportsMarkdown = Array.isArray(documentationFormat) && documentationFormat.indexOf(MarkupKind.Markdown) !== -1;
}

@@ -980,0 +1043,0 @@ return this.supportsMarkdown;

@@ -8,3 +8,3 @@ /*---------------------------------------------------------------------------------------------

import * as languageFacts from '../languageFacts/facts';
import { selectorToMarkedString, simpleSelectorToMarkedString } from './selectorPrinting';
import { SelectorPrinting } from './selectorPrinting';
import { startsWith } from '../utils/strings';

@@ -14,4 +14,6 @@ import { Range, MarkupKind } from '../cssLanguageTypes';

var CSSHover = /** @class */ (function () {
function CSSHover(clientCapabilities) {
function CSSHover(clientCapabilities, cssDataManager) {
this.clientCapabilities = clientCapabilities;
this.cssDataManager = cssDataManager;
this.selectorPrinting = new SelectorPrinting(cssDataManager);
}

@@ -33,3 +35,3 @@ CSSHover.prototype.doHover = function (document, position, stylesheet) {

hover = {
contents: selectorToMarkedString(node),
contents: this.selectorPrinting.selectorToMarkedString(node),
range: getRange(node)

@@ -45,3 +47,3 @@ };

hover = {
contents: simpleSelectorToMarkedString(node),
contents: this.selectorPrinting.simpleSelectorToMarkedString(node),
range: getRange(node)

@@ -54,8 +56,14 @@ };

var propertyName = node.getFullPropertyName();
var entry = languageFacts.cssDataManager.getProperty(propertyName);
var entry = this.cssDataManager.getProperty(propertyName);
if (entry) {
hover = {
contents: languageFacts.getEntryDescription(entry, this.doesSupportMarkdown()),
range: getRange(node)
};
var contents = languageFacts.getEntryDescription(entry, this.doesSupportMarkdown());
if (contents) {
hover = {
contents: contents,
range: getRange(node)
};
}
else {
hover = null;
}
}

@@ -66,8 +74,14 @@ continue;

var atRuleName = node.getText();
var entry = languageFacts.cssDataManager.getAtDirective(atRuleName);
var entry = this.cssDataManager.getAtDirective(atRuleName);
if (entry) {
hover = {
contents: languageFacts.getEntryDescription(entry, this.doesSupportMarkdown()),
range: getRange(node)
};
var contents = languageFacts.getEntryDescription(entry, this.doesSupportMarkdown());
if (contents) {
hover = {
contents: contents,
range: getRange(node)
};
}
else {
hover = null;
}
}

@@ -79,9 +93,15 @@ continue;

var entry = selectorName.slice(0, 2) === '::'
? languageFacts.cssDataManager.getPseudoElement(selectorName)
: languageFacts.cssDataManager.getPseudoClass(selectorName);
? this.cssDataManager.getPseudoElement(selectorName)
: this.cssDataManager.getPseudoClass(selectorName);
if (entry) {
hover = {
contents: languageFacts.getEntryDescription(entry, this.doesSupportMarkdown()),
range: getRange(node)
};
var contents = languageFacts.getEntryDescription(entry, this.doesSupportMarkdown());
if (contents) {
hover = {
contents: contents,
range: getRange(node)
};
}
else {
hover = null;
}
}

@@ -88,0 +108,0 @@ continue;

@@ -42,4 +42,4 @@ /*---------------------------------------------------------------------------------------------

};
import { DocumentHighlightKind, Location, Range, SymbolKind, TextEdit } from '../cssLanguageTypes';
import * as nls from './../../../fillers/vscode-nls';
import { DocumentHighlightKind, Location, Range, SymbolKind, TextEdit, FileType } from '../cssLanguageTypes';
import * as nls from '../../../fillers/vscode-nls';
import * as nodes from '../parser/cssNodes';

@@ -49,5 +49,7 @@ import { Symbols } from '../parser/cssSymbolScope';

import { startsWith } from '../utils/strings';
import { dirname, joinPath } from '../utils/resources';
var localize = nls.loadMessageBundle();
var CSSNavigation = /** @class */ (function () {
function CSSNavigation() {
function CSSNavigation(fileSystemProvider) {
this.fileSystemProvider = fileSystemProvider;
}

@@ -117,9 +119,68 @@ CSSNavigation.prototype.findDefinition = function (document, position, stylesheet) {

CSSNavigation.prototype.findDocumentLinks = function (document, stylesheet, documentContext) {
var links = this.findUnresolvedLinks(document, stylesheet);
for (var i = 0; i < links.length; i++) {
var target = links[i].target;
if (target && !(/^\w+:\/\//g.test(target))) {
var resolved = documentContext.resolveReference(target, document.uri);
if (resolved) {
links[i].target = resolved;
}
}
}
return links;
};
CSSNavigation.prototype.findDocumentLinks2 = function (document, stylesheet, documentContext) {
return __awaiter(this, void 0, void 0, function () {
var links, resolvedLinks, _i, links_1, link, target, resolvedTarget;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
links = this.findUnresolvedLinks(document, stylesheet);
resolvedLinks = [];
_i = 0, links_1 = links;
_a.label = 1;
case 1:
if (!(_i < links_1.length)) return [3 /*break*/, 5];
link = links_1[_i];
target = link.target;
if (!(target && !(/^\w+:\/\//g.test(target)))) return [3 /*break*/, 3];
return [4 /*yield*/, this.resolveRelativeReference(target, document.uri, documentContext)];
case 2:
resolvedTarget = _a.sent();
if (resolvedTarget !== undefined) {
link.target = resolvedTarget;
resolvedLinks.push(link);
}
return [3 /*break*/, 4];
case 3:
resolvedLinks.push(link);
_a.label = 4;
case 4:
_i++;
return [3 /*break*/, 1];
case 5: return [2 /*return*/, resolvedLinks];
}
});
});
};
CSSNavigation.prototype.findUnresolvedLinks = function (document, stylesheet) {
var _this = this;
var result = [];
var collect = function (uriStringNode) {
var rawUri = uriStringNode.getText();
var range = getRange(uriStringNode, document);
// Make sure the range is not empty
if (range.start.line === range.end.line && range.start.character === range.end.character) {
return;
}
if (startsWith(rawUri, "'") || startsWith(rawUri, "\"")) {
rawUri = rawUri.slice(1, -1);
}
result.push({ target: rawUri, range: range });
};
stylesheet.accept(function (candidate) {
if (candidate.type === nodes.NodeType.URILiteral) {
var link = uriLiteralNodeToDocumentLink(document, candidate, documentContext);
if (link) {
result.push(link);
var first = candidate.getChild(0);
if (first) {
collect(first);
}

@@ -135,6 +196,3 @@ return false;

if (startsWith(rawText, "'") || startsWith(rawText, "\"")) {
var link = uriStringNodeToDocumentLink(document, candidate, documentContext);
if (link) {
result.push(link);
}
collect(candidate);
}

@@ -147,9 +205,2 @@ return false;

};
CSSNavigation.prototype.findDocumentLinks2 = function (document, stylesheet, documentContext) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this.findDocumentLinks(document, stylesheet, documentContext)];
});
});
};
CSSNavigation.prototype.findDocumentSymbols = function (document, stylesheet) {

@@ -253,2 +304,75 @@ var result = [];

};
CSSNavigation.prototype.resolveRelativeReference = function (ref, documentUri, documentContext) {
return __awaiter(this, void 0, void 0, function () {
var moduleName, rootFolderUri, documentFolderUri, modulePath, pathWithinModule;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!(ref[0] === '~' && ref[1] !== '/' && this.fileSystemProvider)) return [3 /*break*/, 3];
ref = ref.substring(1);
if (!startsWith(documentUri, 'file://')) return [3 /*break*/, 2];
moduleName = getModuleNameFromPath(ref);
rootFolderUri = documentContext.resolveReference('/', documentUri);
documentFolderUri = dirname(documentUri);
return [4 /*yield*/, this.resolvePathToModule(moduleName, documentFolderUri, rootFolderUri)];
case 1:
modulePath = _a.sent();
if (modulePath) {
pathWithinModule = ref.substring(moduleName.length + 1);
return [2 /*return*/, joinPath(modulePath, pathWithinModule)];
}
_a.label = 2;
case 2: return [2 /*return*/, documentContext.resolveReference(ref, documentUri)];
case 3: return [2 /*return*/, documentContext.resolveReference(ref, documentUri)];
}
});
});
};
CSSNavigation.prototype.resolvePathToModule = function (_moduleName, documentFolderUri, rootFolderUri) {
return __awaiter(this, void 0, void 0, function () {
var packPath;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
packPath = joinPath(documentFolderUri, 'node_modules', _moduleName, 'package.json');
return [4 /*yield*/, this.fileExists(packPath)];
case 1:
if (_a.sent()) {
return [2 /*return*/, dirname(packPath)];
}
else if (rootFolderUri && documentFolderUri.startsWith(rootFolderUri) && (documentFolderUri.length !== rootFolderUri.length)) {
return [2 /*return*/, this.resolvePathToModule(_moduleName, dirname(documentFolderUri), rootFolderUri)];
}
return [2 /*return*/, undefined];
}
});
});
};
CSSNavigation.prototype.fileExists = function (uri) {
return __awaiter(this, void 0, void 0, function () {
var stat, err_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!this.fileSystemProvider) {
return [2 /*return*/, false];
}
_a.label = 1;
case 1:
_a.trys.push([1, 3, , 4]);
return [4 /*yield*/, this.fileSystemProvider.stat(uri)];
case 2:
stat = _a.sent();
if (stat.type === FileType.Unknown && stat.size === -1) {
return [2 /*return*/, false];
}
return [2 /*return*/, true];
case 3:
err_1 = _a.sent();
return [2 /*return*/, false];
case 4: return [2 /*return*/];
}
});
});
};
return CSSNavigation;

@@ -265,37 +389,2 @@ }());

}
function uriLiteralNodeToDocumentLink(document, uriLiteralNode, documentContext) {
if (uriLiteralNode.getChildren().length === 0) {
return null;
}
var uriStringNode = uriLiteralNode.getChild(0);
return uriStringNodeToDocumentLink(document, uriStringNode, documentContext);
}
function uriStringNodeToDocumentLink(document, uriStringNode, documentContext) {
if (!uriStringNode) {
return null;
}
var rawUri = uriStringNode.getText();
var range = getRange(uriStringNode, document);
// Make sure the range is not empty
if (range.start.line === range.end.line && range.start.character === range.end.character) {
return null;
}
if (startsWith(rawUri, "'") || startsWith(rawUri, "\"")) {
rawUri = rawUri.slice(1, -1);
}
var target;
if (startsWith(rawUri, 'http://') || startsWith(rawUri, 'https://')) {
target = rawUri;
}
else if (/^\w+:\/\//g.test(rawUri)) {
target = rawUri;
}
else {
target = documentContext.resolveReference(rawUri, document.uri);
}
return {
range: range,
target: target
};
}
function getRange(node, document) {

@@ -331,1 +420,8 @@ return Range.create(document.positionAt(node.offset), document.positionAt(node.end));

}
function getModuleNameFromPath(path) {
// If a scoped module (starts with @) then get up until second instance of '/', otherwise get until first instance of '/'
if (path[0] === '@') {
return path.substring(0, path.indexOf('/', path.indexOf('/') + 1));
}
return path.substring(0, path.indexOf('/'));
}

@@ -22,3 +22,4 @@ /*---------------------------------------------------------------------------------------------

function getApplicableRanges(position) {
var currNode = stylesheet.findChildAtOffset(document.offsetAt(position), true);
var offset = document.offsetAt(position);
var currNode = stylesheet.findChildAtOffset(offset, true);
if (!currNode) {

@@ -35,8 +36,10 @@ return [];

}
// The `{ }` part of `.a { }`
if (currNode.type === NodeType.Declarations) {
result.push([currNode.offset + 1, currNode.end - 1]);
if (offset > currNode.offset && offset < currNode.end) {
// Return `{ }` and the range inside `{` and `}`
result.push([currNode.offset + 1, currNode.end - 1]);
}
}
else {
result.push([currNode.offset, currNode.end]);
}
result.push([currNode.offset, currNode.end]);
currNode = currNode.parent;

@@ -43,0 +46,0 @@ }

@@ -11,3 +11,4 @@ /*---------------------------------------------------------------------------------------------

var CSSValidation = /** @class */ (function () {
function CSSValidation() {
function CSSValidation(cssDataManager) {
this.cssDataManager = cssDataManager;
}

@@ -24,3 +25,3 @@ CSSValidation.prototype.configure = function (settings) {

entries.push.apply(entries, nodes.ParseErrorCollector.entries(stylesheet));
entries.push.apply(entries, LintVisitor.entries(stylesheet, document, new LintConfigurationSettings(settings && settings.lint)));
entries.push.apply(entries, LintVisitor.entries(stylesheet, document, new LintConfigurationSettings(settings && settings.lint), this.cssDataManager));
var ruleIds = [];

@@ -27,0 +28,0 @@ for (var r in Rules) {

@@ -21,8 +21,8 @@ /*---------------------------------------------------------------------------------------------

import { CompletionItemKind, InsertTextFormat, TextEdit } from '../cssLanguageTypes';
import * as nls from './../../../fillers/vscode-nls';
import * as nls from '../../../fillers/vscode-nls';
var localize = nls.loadMessageBundle();
var LESSCompletion = /** @class */ (function (_super) {
__extends(LESSCompletion, _super);
function LESSCompletion(clientCapabilities) {
return _super.call(this, '@', clientCapabilities) || this;
function LESSCompletion(lsOptions, cssDataManager) {
return _super.call(this, '@', lsOptions, cssDataManager) || this;
}

@@ -29,0 +29,0 @@ LESSCompletion.prototype.createFunctionProposals = function (proposals, existingNode, sortToEnd, result) {

@@ -11,3 +11,3 @@ /*---------------------------------------------------------------------------------------------

import { union } from '../utils/arrays';
import * as nls from './../../../fillers/vscode-nls';
import * as nls from '../../../fillers/vscode-nls';
var localize = nls.loadMessageBundle();

@@ -32,4 +32,5 @@ var NodesByRootMap = /** @class */ (function () {

var LintVisitor = /** @class */ (function () {
function LintVisitor(document, settings) {
function LintVisitor(document, settings, cssDataManager) {
var _this = this;
this.cssDataManager = cssDataManager;
this.warnings = [];

@@ -52,4 +53,4 @@ this.settings = settings;

}
LintVisitor.entries = function (node, document, settings, entryFilter) {
var visitor = new LintVisitor(document, settings);
LintVisitor.entries = function (node, document, settings, cssDataManager, entryFilter) {
var visitor = new LintVisitor(document, settings, cssDataManager);
node.acceptVisitor(visitor);

@@ -161,3 +162,3 @@ visitor.completeValidations();

}
var atDirective = languageFacts.cssDataManager.getAtDirective(atRuleName.getText());
var atDirective = this.cssDataManager.getAtDirective(atRuleName.getText());
if (atDirective) {

@@ -371,3 +372,3 @@ return false;

if (name.charAt(1) !== '-') { // avoid css variables
if (!languageFacts.cssDataManager.isKnownProperty(name) && !this.validProperties[name]) {
if (!this.cssDataManager.isKnownProperty(name) && !this.validProperties[name]) {
this.addEntry(decl.getProperty(), Rules.UnknownVendorSpecificProperty);

@@ -386,5 +387,5 @@ }

// _property and *property might be contributed via custom data
if (!languageFacts.cssDataManager.isKnownProperty(fullName) && !languageFacts.cssDataManager.isKnownProperty(name)) {
if (!this.cssDataManager.isKnownProperty(fullName) && !this.cssDataManager.isKnownProperty(name)) {
if (!this.validProperties[name]) {
this.addEntry(decl.getProperty(), Rules.UnknownProperty, localize('property.unknownproperty.detailed', "Unknown property: '{0}'", name));
this.addEntry(decl.getProperty(), Rules.UnknownProperty, localize('property.unknownproperty.detailed', "Unknown property: '{0}'", decl.getFullPropertyName()));
}

@@ -403,3 +404,3 @@ }

var actual = entry.names;
var needsStandard = languageFacts.cssDataManager.isStandardProperty(suffix) && (actual.indexOf(suffix) === -1);
var needsStandard = this.cssDataManager.isStandardProperty(suffix) && (actual.indexOf(suffix) === -1);
if (!needsStandard && actual.length === 1) {

@@ -411,3 +412,3 @@ continue; // only the non-vendor specific rule is used, that's fine, no warning

var prefix = LintVisitor.prefixes[i];
if (languageFacts.cssDataManager.isStandardProperty(prefix + suffix)) {
if (this.cssDataManager.isStandardProperty(prefix + suffix)) {
expected.push(prefix + suffix);

@@ -414,0 +415,0 @@ }

@@ -7,3 +7,3 @@ /*---------------------------------------------------------------------------------------------

import * as nodes from '../parser/cssNodes';
import * as nls from './../../../fillers/vscode-nls';
import * as nls from '../../../fillers/vscode-nls';
var localize = nls.loadMessageBundle();

@@ -10,0 +10,0 @@ var Warning = nodes.Level.Warning;

@@ -22,8 +22,8 @@ /*---------------------------------------------------------------------------------------------

import { CompletionItemKind, TextEdit, InsertTextFormat } from '../cssLanguageTypes';
import * as nls from './../../../fillers/vscode-nls';
import * as nls from '../../../fillers/vscode-nls';
var localize = nls.loadMessageBundle();
var SCSSCompletion = /** @class */ (function (_super) {
__extends(SCSSCompletion, _super);
function SCSSCompletion(clientCapabilities) {
var _this = _super.call(this, '$', clientCapabilities) || this;
function SCSSCompletion(lsServiceOptions, cssDataManager) {
var _this = _super.call(this, '$', lsServiceOptions, cssDataManager) || this;
addReferencesToDocumentation(SCSSCompletion.scssModuleLoaders);

@@ -39,6 +39,14 @@ addReferencesToDocumentation(SCSSCompletion.scssModuleBuiltIns);

SCSSCompletion.prototype.getCompletionForImportPath = function (importPathNode, result) {
var _a;
var parentType = importPathNode.getParent().type;
if (parentType === nodes.NodeType.Forward || parentType === nodes.NodeType.Use) {
(_a = result.items).push.apply(_a, SCSSCompletion.scssModuleBuiltIns);
for (var _i = 0, _a = SCSSCompletion.scssModuleBuiltIns; _i < _a.length; _i++) {
var p = _a[_i];
var item = {
label: p.label,
documentation: p.documentation,
textEdit: TextEdit.replace(this.getCompletionRange(importPathNode), "'" + p.label + "'"),
kind: CompletionItemKind.Module
};
result.items.push(item);
}
}

@@ -316,4 +324,3 @@ return _super.prototype.getCompletionForImportPath.call(this, importPathNode, result);

documentation: localize('scss.builtin.sass:math', 'Provides functions that operate on numbers.'),
references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/math' }],
kind: CompletionItemKind.Module,
references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/math' }]
},

@@ -323,4 +330,3 @@ {

documentation: localize('scss.builtin.sass:string', 'Makes it easy to combine, search, or split apart strings.'),
references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/string' }],
kind: CompletionItemKind.Module,
references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/string' }]
},

@@ -330,4 +336,3 @@ {

documentation: localize('scss.builtin.sass:color', 'Generates new colors based on existing ones, making it easy to build color themes.'),
references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/color' }],
kind: CompletionItemKind.Module,
references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/color' }]
},

@@ -337,4 +342,3 @@ {

documentation: localize('scss.builtin.sass:list', 'Lets you access and modify values in lists.'),
references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/list' }],
kind: CompletionItemKind.Module,
references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/list' }]
},

@@ -344,4 +348,3 @@ {

documentation: localize('scss.builtin.sass:map', 'Makes it possible to look up the value associated with a key in a map, and much more.'),
references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/map' }],
kind: CompletionItemKind.Module,
references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/map' }]
},

@@ -351,4 +354,3 @@ {

documentation: localize('scss.builtin.sass:selector', 'Provides access to Sass’s powerful selector engine.'),
references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/selector' }],
kind: CompletionItemKind.Module,
references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/selector' }]
},

@@ -358,4 +360,3 @@ {

documentation: localize('scss.builtin.sass:meta', 'Exposes the details of Sass’s inner workings.'),
references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/meta' }],
kind: CompletionItemKind.Module,
references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/meta' }]
},

@@ -362,0 +363,0 @@ ];

@@ -19,13 +19,2 @@ /*---------------------------------------------------------------------------------------------

})();
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -68,11 +57,10 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

import { CSSNavigation } from './cssNavigation';
import { FileType } from '../cssLanguageTypes';
import * as nodes from '../parser/cssNodes';
import { URI } from './../../vscode-uri/index';
import { URI } from '../../vscode-uri/index';
import { startsWith } from '../utils/strings';
import { extname } from '../utils/resources';
var SCSSNavigation = /** @class */ (function (_super) {
__extends(SCSSNavigation, _super);
function SCSSNavigation(fileSystemProvider) {
var _this = _super.call(this) || this;
_this.fileSystemProvider = fileSystemProvider;
return _this;
return _super.call(this, fileSystemProvider) || this;
}

@@ -84,3 +72,3 @@ SCSSNavigation.prototype.isRawStringDocumentLinkNode = function (node) {

};
SCSSNavigation.prototype.findDocumentLinks2 = function (document, stylesheet, documentContext) {
SCSSNavigation.prototype.resolveRelativeReference = function (ref, documentUri, documentContext) {
return __awaiter(this, void 0, void 0, function () {

@@ -127,86 +115,37 @@ function toPathVariations(uri) {

}
function fileExists(documentUri) {
return __awaiter(this, void 0, void 0, function () {
var stat, err_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!fsProvider) {
return [2 /*return*/, false];
}
_a.label = 1;
case 1:
_a.trys.push([1, 3, , 4]);
return [4 /*yield*/, fsProvider.stat(documentUri)];
case 2:
stat = _a.sent();
if (stat.type === FileType.Unknown && stat.size === -1) {
return [2 /*return*/, false];
}
return [2 /*return*/, true];
case 3:
err_1 = _a.sent();
return [2 /*return*/, false];
case 4: return [2 /*return*/];
}
});
});
}
var links, fsProvider, validLinks, i, target, parsedUri, pathVariations, j;
var target, parsedUri, pathVariations, j, e_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
links = this.findDocumentLinks(document, stylesheet, documentContext);
fsProvider = this.fileSystemProvider;
validLinks = [];
if (!fsProvider) return [3 /*break*/, 9];
i = 0;
_a.label = 1;
if (startsWith(ref, 'sass:')) {
return [2 /*return*/, undefined]; // sass library
}
return [4 /*yield*/, _super.prototype.resolveRelativeReference.call(this, ref, documentUri, documentContext)];
case 1:
if (!(i < links.length)) return [3 /*break*/, 8];
target = links[i].target;
if (!target) {
return [3 /*break*/, 7];
}
parsedUri = null;
try {
parsedUri = URI.parse(target);
}
catch (e) {
if (e instanceof URIError) {
return [3 /*break*/, 7];
}
throw e;
}
target = _a.sent();
if (!(this.fileSystemProvider && target && extname(target).length === 0)) return [3 /*break*/, 8];
_a.label = 2;
case 2:
_a.trys.push([2, 7, , 8]);
parsedUri = URI.parse(target);
pathVariations = toPathVariations(parsedUri);
if (!!pathVariations) return [3 /*break*/, 3];
return [4 /*yield*/, fileExists(target)];
case 2:
if (_a.sent()) {
validLinks.push(links[i]);
}
return [3 /*break*/, 7];
if (!pathVariations) return [3 /*break*/, 6];
j = 0;
_a.label = 3;
case 3:
j = 0;
_a.label = 4;
if (!(j < pathVariations.length)) return [3 /*break*/, 6];
return [4 /*yield*/, this.fileExists(pathVariations[j])];
case 4:
if (!(j < pathVariations.length)) return [3 /*break*/, 7];
return [4 /*yield*/, fileExists(pathVariations[j])];
case 5:
if (_a.sent()) {
validLinks.push(__assign(__assign({}, links[i]), { target: pathVariations[j] }));
return [3 /*break*/, 7];
return [2 /*return*/, pathVariations[j]];
}
_a.label = 6;
case 6:
_a.label = 5;
case 5:
j++;
return [3 /*break*/, 4];
return [3 /*break*/, 3];
case 6: return [2 /*return*/, undefined];
case 7:
i++;
return [3 /*break*/, 1];
case 8: return [3 /*break*/, 10];
case 9:
validLinks.push.apply(validLinks, links);
_a.label = 10;
case 10: return [2 /*return*/, validLinks];
e_1 = _a.sent();
return [3 /*break*/, 8];
case 8: return [2 /*return*/, target];
}

@@ -213,0 +152,0 @@ });

@@ -21,4 +21,3 @@ /*---------------------------------------------------------------------------------------------

import { Scanner } from '../parser/cssScanner';
import * as languageFacts from "../languageFacts/facts";
import * as nls from './../../../fillers/vscode-nls';
import * as nls from '../../../fillers/vscode-nls';
var localize = nls.loadMessageBundle();

@@ -333,68 +332,77 @@ var Element = /** @class */ (function () {

}
function isPseudoElementIdentifier(text) {
var match = text.match(/^::?([\w-]+)/);
if (!match) {
return false;
var SelectorPrinting = /** @class */ (function () {
function SelectorPrinting(cssDataManager) {
this.cssDataManager = cssDataManager;
}
return !!languageFacts.cssDataManager.getPseudoElement("::" + match[1]);
}
function selectorToSpecificityMarkedString(node) {
//https://www.w3.org/TR/selectors-3/#specificity
function calculateScore(node) {
node.getChildren().forEach(function (element) {
switch (element.type) {
case nodes.NodeType.IdentifierSelector:
specificity.id++;
break;
case nodes.NodeType.ClassSelector:
case nodes.NodeType.AttributeSelector:
specificity.attr++;
break;
case nodes.NodeType.ElementNameSelector:
//ignore universal selector
if (element.matches("*")) {
SelectorPrinting.prototype.selectorToMarkedString = function (node) {
var root = selectorToElement(node);
if (root) {
var markedStrings = new MarkedStringPrinter('"').print(root);
markedStrings.push(this.selectorToSpecificityMarkedString(node));
return markedStrings;
}
else {
return [];
}
};
SelectorPrinting.prototype.simpleSelectorToMarkedString = function (node) {
var element = toElement(node);
var markedStrings = new MarkedStringPrinter('"').print(element);
markedStrings.push(this.selectorToSpecificityMarkedString(node));
return markedStrings;
};
SelectorPrinting.prototype.isPseudoElementIdentifier = function (text) {
var match = text.match(/^::?([\w-]+)/);
if (!match) {
return false;
}
return !!this.cssDataManager.getPseudoElement("::" + match[1]);
};
SelectorPrinting.prototype.selectorToSpecificityMarkedString = function (node) {
var _this = this;
//https://www.w3.org/TR/selectors-3/#specificity
var calculateScore = function (node) {
for (var _i = 0, _a = node.getChildren(); _i < _a.length; _i++) {
var element = _a[_i];
switch (element.type) {
case nodes.NodeType.IdentifierSelector:
specificity.id++;
break;
}
specificity.tag++;
break;
case nodes.NodeType.PseudoSelector:
var text = element.getText();
if (isPseudoElementIdentifier(text)) {
specificity.tag++; // pseudo element
}
else {
//ignore psuedo class NOT
if (text.match(/^:not/i)) {
case nodes.NodeType.ClassSelector:
case nodes.NodeType.AttributeSelector:
specificity.attr++;
break;
case nodes.NodeType.ElementNameSelector:
//ignore universal selector
if (element.matches("*")) {
break;
}
specificity.attr++; //pseudo class
}
break;
specificity.tag++;
break;
case nodes.NodeType.PseudoSelector:
var text = element.getText();
if (_this.isPseudoElementIdentifier(text)) {
specificity.tag++; // pseudo element
}
else {
//ignore psuedo class NOT
if (text.match(/^:not/i)) {
break;
}
specificity.attr++; //pseudo class
}
break;
}
if (element.getChildren().length > 0) {
calculateScore(element);
}
}
if (element.getChildren().length > 0) {
calculateScore(element);
}
});
}
var specificity = new Specificity();
calculateScore(node);
return localize('specificity', "[Selector Specificity](https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity): ({0}, {1}, {2})", specificity.id, specificity.attr, specificity.tag);
}
export function selectorToMarkedString(node) {
var root = selectorToElement(node);
if (root) {
var markedStrings = new MarkedStringPrinter('"').print(root);
markedStrings.push(selectorToSpecificityMarkedString(node));
return markedStrings;
}
else {
return [];
}
}
export function simpleSelectorToMarkedString(node) {
var element = toElement(node);
var markedStrings = new MarkedStringPrinter('"').print(element);
markedStrings.push(selectorToSpecificityMarkedString(node));
return markedStrings;
}
};
var specificity = new Specificity();
calculateScore(node);
return localize('specificity', "[Selector Specificity](https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity): ({0}, {1}, {2})", specificity.id, specificity.attr, specificity.tag);
};
return SelectorPrinting;
}());
export { SelectorPrinting };
var SelectorElementBuilder = /** @class */ (function () {

@@ -401,0 +409,0 @@ function SelectorElementBuilder(element) {

@@ -84,1 +84,11 @@ /*---------------------------------------------------------------------------------------------

}
/**
* Limit of string length.
*/
export function trim(str, regexp) {
var m = regexp.exec(str);
if (m && m[0].length) {
return str.substr(0, str.length - m[0].length);
}
return str;
}

@@ -117,2 +117,3 @@ /*---------------------------------------------------------------------------------------------

*
* ```txt
* foo://example.com:8042/over/there?name=ferret#nose

@@ -125,2 +126,3 @@ * \_/ \______________/\_________/ \_________/ \__/

* urn:example:animal:ferret:nose
* ```
*/

@@ -198,3 +200,3 @@ var URI = /** @class */ (function () {

// }
return _makeFsPath(this);
return uriToFsPath(this, false);
},

@@ -262,3 +264,3 @@ enumerable: true,

}
return new _URI(match[2] || _empty, decodeURIComponent(match[4] || _empty), decodeURIComponent(match[5] || _empty), decodeURIComponent(match[7] || _empty), decodeURIComponent(match[9] || _empty), _strict);
return new _URI(match[2] || _empty, percentDecode(match[4] || _empty), percentDecode(match[5] || _empty), percentDecode(match[7] || _empty), percentDecode(match[9] || _empty), _strict);
};

@@ -312,2 +314,21 @@ /**

};
// /**
// * Join a URI path with path fragments and normalizes the resulting path.
// *
// * @param uri The input URI.
// * @param pathFragment The path fragment to add to the URI path.
// * @returns The resulting URI.
// */
// static joinPath(uri: URI, ...pathFragment: string[]): URI {
// if (!uri.path) {
// throw new Error(`[UriError]: cannot call joinPaths on URI without path`);
// }
// let newPath: string;
// if (isWindows && uri.scheme === 'file') {
// newPath = URI.file(paths.win32.join(uriToFsPath(uri, true), ...pathFragment)).path;
// } else {
// newPath = paths.posix.join(uri.path, ...pathFragment);
// }
// return uri.with({ path: newPath });
// }
// ---- printing/externalize ---------------------------

@@ -350,3 +371,3 @@ /**

var _pathSepMarker = isWindows ? 1 : undefined;
// tslint:disable-next-line:class-name
// eslint-disable-next-line @typescript-eslint/class-name-casing
var _URI = /** @class */ (function (_super) {

@@ -363,3 +384,3 @@ __extends(_URI, _super);

if (!this._fsPath) {
this._fsPath = _makeFsPath(this);
this._fsPath = uriToFsPath(this, false);
}

@@ -510,3 +531,3 @@ return this._fsPath;

*/
function _makeFsPath(uri) {
export function uriToFsPath(uri, keepDriveLetterCasing) {
var value;

@@ -520,4 +541,9 @@ if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') {

&& uri.path.charCodeAt(2) === 58 /* Colon */) {
// windows drive letter: file:///c:/far/boo
value = uri.path[1].toLowerCase() + uri.path.substr(2);
if (!keepDriveLetterCasing) {
// windows drive letter: file:///c:/far/boo
value = uri.path[1].toLowerCase() + uri.path.substr(2);
}
else {
value = uri.path.substr(1);
}
}

@@ -606,1 +632,22 @@ else {

}
// --- decode
function decodeURIComponentGraceful(str) {
try {
return decodeURIComponent(str);
}
catch (_a) {
if (str.length > 3) {
return str.substr(0, 3) + decodeURIComponentGraceful(str.substr(3));
}
else {
return str;
}
}
}
var _rEncodedAsHex = /(%[0-9A-Za-z][0-9A-Za-z])+/g;
function percentDecode(str) {
if (!str.match(_rEncodedAsHex)) {
return str;
}
return str.replace(_rEncodedAsHex, function (match) { return decodeURIComponentGraceful(match); });
}

@@ -5,3 +5,2 @@ /*---------------------------------------------------------------------------------------------

*--------------------------------------------------------------------------------------------*/
'use strict';
import * as worker from 'monaco-editor-core/esm/vs/editor/editor.worker';

@@ -8,0 +7,0 @@ import { CSSWorker } from './cssWorker';

@@ -5,5 +5,5 @@ /*---------------------------------------------------------------------------------------------

*--------------------------------------------------------------------------------------------*/
'use strict';
import { WorkerManager } from './workerManager';
import * as languageFeatures from './languageFeatures';
import { languages } from './fillers/monaco-editor-core';
export function setupMode(defaults) {

@@ -25,27 +25,27 @@ var disposables = [];

if (modeConfiguration.completionItems) {
providers.push(monaco.languages.registerCompletionItemProvider(languageId, new languageFeatures.CompletionAdapter(worker)));
providers.push(languages.registerCompletionItemProvider(languageId, new languageFeatures.CompletionAdapter(worker)));
}
if (modeConfiguration.hovers) {
providers.push(monaco.languages.registerHoverProvider(languageId, new languageFeatures.HoverAdapter(worker)));
providers.push(languages.registerHoverProvider(languageId, new languageFeatures.HoverAdapter(worker)));
}
if (modeConfiguration.documentHighlights) {
providers.push(monaco.languages.registerDocumentHighlightProvider(languageId, new languageFeatures.DocumentHighlightAdapter(worker)));
providers.push(languages.registerDocumentHighlightProvider(languageId, new languageFeatures.DocumentHighlightAdapter(worker)));
}
if (modeConfiguration.definitions) {
providers.push(monaco.languages.registerDefinitionProvider(languageId, new languageFeatures.DefinitionAdapter(worker)));
providers.push(languages.registerDefinitionProvider(languageId, new languageFeatures.DefinitionAdapter(worker)));
}
if (modeConfiguration.references) {
providers.push(monaco.languages.registerReferenceProvider(languageId, new languageFeatures.ReferenceAdapter(worker)));
providers.push(languages.registerReferenceProvider(languageId, new languageFeatures.ReferenceAdapter(worker)));
}
if (modeConfiguration.documentSymbols) {
providers.push(monaco.languages.registerDocumentSymbolProvider(languageId, new languageFeatures.DocumentSymbolAdapter(worker)));
providers.push(languages.registerDocumentSymbolProvider(languageId, new languageFeatures.DocumentSymbolAdapter(worker)));
}
if (modeConfiguration.rename) {
providers.push(monaco.languages.registerRenameProvider(languageId, new languageFeatures.RenameAdapter(worker)));
providers.push(languages.registerRenameProvider(languageId, new languageFeatures.RenameAdapter(worker)));
}
if (modeConfiguration.colors) {
providers.push(monaco.languages.registerColorProvider(languageId, new languageFeatures.DocumentColorAdapter(worker)));
providers.push(languages.registerColorProvider(languageId, new languageFeatures.DocumentColorAdapter(worker)));
}
if (modeConfiguration.foldingRanges) {
providers.push(monaco.languages.registerFoldingRangeProvider(languageId, new languageFeatures.FoldingRangeAdapter(worker)));
providers.push(languages.registerFoldingRangeProvider(languageId, new languageFeatures.FoldingRangeAdapter(worker)));
}

@@ -56,3 +56,3 @@ if (modeConfiguration.diagnostics) {

if (modeConfiguration.selectionRanges) {
providers.push(monaco.languages.registerSelectionRangeProvider(languageId, new languageFeatures.SelectionRangeAdapter(worker)));
providers.push(languages.registerSelectionRangeProvider(languageId, new languageFeatures.SelectionRangeAdapter(worker)));
}

@@ -59,0 +59,0 @@ }

@@ -5,3 +5,38 @@ /*---------------------------------------------------------------------------------------------

*--------------------------------------------------------------------------------------------*/
'use strict';
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
import * as cssService from './_deps/vscode-css-languageservice/cssLanguageService';

@@ -30,80 +65,145 @@ var CSSWorker = /** @class */ (function () {

CSSWorker.prototype.doValidation = function (uri) {
var document = this._getTextDocument(uri);
if (document) {
var stylesheet = this._languageService.parseStylesheet(document);
var diagnostics = this._languageService.doValidation(document, stylesheet);
return Promise.resolve(diagnostics);
}
return Promise.resolve([]);
return __awaiter(this, void 0, void 0, function () {
var document, stylesheet, diagnostics;
return __generator(this, function (_a) {
document = this._getTextDocument(uri);
if (document) {
stylesheet = this._languageService.parseStylesheet(document);
diagnostics = this._languageService.doValidation(document, stylesheet);
return [2 /*return*/, Promise.resolve(diagnostics)];
}
return [2 /*return*/, Promise.resolve([])];
});
});
};
CSSWorker.prototype.doComplete = function (uri, position) {
var document = this._getTextDocument(uri);
var stylesheet = this._languageService.parseStylesheet(document);
var completions = this._languageService.doComplete(document, position, stylesheet);
return Promise.resolve(completions);
return __awaiter(this, void 0, void 0, function () {
var document, stylesheet, completions;
return __generator(this, function (_a) {
document = this._getTextDocument(uri);
stylesheet = this._languageService.parseStylesheet(document);
completions = this._languageService.doComplete(document, position, stylesheet);
return [2 /*return*/, Promise.resolve(completions)];
});
});
};
CSSWorker.prototype.doHover = function (uri, position) {
var document = this._getTextDocument(uri);
var stylesheet = this._languageService.parseStylesheet(document);
var hover = this._languageService.doHover(document, position, stylesheet);
return Promise.resolve(hover);
return __awaiter(this, void 0, void 0, function () {
var document, stylesheet, hover;
return __generator(this, function (_a) {
document = this._getTextDocument(uri);
stylesheet = this._languageService.parseStylesheet(document);
hover = this._languageService.doHover(document, position, stylesheet);
return [2 /*return*/, Promise.resolve(hover)];
});
});
};
CSSWorker.prototype.findDefinition = function (uri, position) {
var document = this._getTextDocument(uri);
var stylesheet = this._languageService.parseStylesheet(document);
var definition = this._languageService.findDefinition(document, position, stylesheet);
return Promise.resolve(definition);
return __awaiter(this, void 0, void 0, function () {
var document, stylesheet, definition;
return __generator(this, function (_a) {
document = this._getTextDocument(uri);
stylesheet = this._languageService.parseStylesheet(document);
definition = this._languageService.findDefinition(document, position, stylesheet);
return [2 /*return*/, Promise.resolve(definition)];
});
});
};
CSSWorker.prototype.findReferences = function (uri, position) {
var document = this._getTextDocument(uri);
var stylesheet = this._languageService.parseStylesheet(document);
var references = this._languageService.findReferences(document, position, stylesheet);
return Promise.resolve(references);
return __awaiter(this, void 0, void 0, function () {
var document, stylesheet, references;
return __generator(this, function (_a) {
document = this._getTextDocument(uri);
stylesheet = this._languageService.parseStylesheet(document);
references = this._languageService.findReferences(document, position, stylesheet);
return [2 /*return*/, Promise.resolve(references)];
});
});
};
CSSWorker.prototype.findDocumentHighlights = function (uri, position) {
var document = this._getTextDocument(uri);
var stylesheet = this._languageService.parseStylesheet(document);
var highlights = this._languageService.findDocumentHighlights(document, position, stylesheet);
return Promise.resolve(highlights);
return __awaiter(this, void 0, void 0, function () {
var document, stylesheet, highlights;
return __generator(this, function (_a) {
document = this._getTextDocument(uri);
stylesheet = this._languageService.parseStylesheet(document);
highlights = this._languageService.findDocumentHighlights(document, position, stylesheet);
return [2 /*return*/, Promise.resolve(highlights)];
});
});
};
CSSWorker.prototype.findDocumentSymbols = function (uri) {
var document = this._getTextDocument(uri);
var stylesheet = this._languageService.parseStylesheet(document);
var symbols = this._languageService.findDocumentSymbols(document, stylesheet);
return Promise.resolve(symbols);
return __awaiter(this, void 0, void 0, function () {
var document, stylesheet, symbols;
return __generator(this, function (_a) {
document = this._getTextDocument(uri);
stylesheet = this._languageService.parseStylesheet(document);
symbols = this._languageService.findDocumentSymbols(document, stylesheet);
return [2 /*return*/, Promise.resolve(symbols)];
});
});
};
CSSWorker.prototype.doCodeActions = function (uri, range, context) {
var document = this._getTextDocument(uri);
var stylesheet = this._languageService.parseStylesheet(document);
var actions = this._languageService.doCodeActions(document, range, context, stylesheet);
return Promise.resolve(actions);
return __awaiter(this, void 0, void 0, function () {
var document, stylesheet, actions;
return __generator(this, function (_a) {
document = this._getTextDocument(uri);
stylesheet = this._languageService.parseStylesheet(document);
actions = this._languageService.doCodeActions(document, range, context, stylesheet);
return [2 /*return*/, Promise.resolve(actions)];
});
});
};
CSSWorker.prototype.findDocumentColors = function (uri) {
var document = this._getTextDocument(uri);
var stylesheet = this._languageService.parseStylesheet(document);
var colorSymbols = this._languageService.findDocumentColors(document, stylesheet);
return Promise.resolve(colorSymbols);
return __awaiter(this, void 0, void 0, function () {
var document, stylesheet, colorSymbols;
return __generator(this, function (_a) {
document = this._getTextDocument(uri);
stylesheet = this._languageService.parseStylesheet(document);
colorSymbols = this._languageService.findDocumentColors(document, stylesheet);
return [2 /*return*/, Promise.resolve(colorSymbols)];
});
});
};
CSSWorker.prototype.getColorPresentations = function (uri, color, range) {
var document = this._getTextDocument(uri);
var stylesheet = this._languageService.parseStylesheet(document);
var colorPresentations = this._languageService.getColorPresentations(document, stylesheet, color, range);
return Promise.resolve(colorPresentations);
return __awaiter(this, void 0, void 0, function () {
var document, stylesheet, colorPresentations;
return __generator(this, function (_a) {
document = this._getTextDocument(uri);
stylesheet = this._languageService.parseStylesheet(document);
colorPresentations = this._languageService.getColorPresentations(document, stylesheet, color, range);
return [2 /*return*/, Promise.resolve(colorPresentations)];
});
});
};
CSSWorker.prototype.getFoldingRanges = function (uri, context) {
var document = this._getTextDocument(uri);
var ranges = this._languageService.getFoldingRanges(document, context);
return Promise.resolve(ranges);
return __awaiter(this, void 0, void 0, function () {
var document, ranges;
return __generator(this, function (_a) {
document = this._getTextDocument(uri);
ranges = this._languageService.getFoldingRanges(document, context);
return [2 /*return*/, Promise.resolve(ranges)];
});
});
};
CSSWorker.prototype.getSelectionRanges = function (uri, positions) {
var document = this._getTextDocument(uri);
var stylesheet = this._languageService.parseStylesheet(document);
var ranges = this._languageService.getSelectionRanges(document, positions, stylesheet);
return Promise.resolve(ranges);
return __awaiter(this, void 0, void 0, function () {
var document, stylesheet, ranges;
return __generator(this, function (_a) {
document = this._getTextDocument(uri);
stylesheet = this._languageService.parseStylesheet(document);
ranges = this._languageService.getSelectionRanges(document, positions, stylesheet);
return [2 /*return*/, Promise.resolve(ranges)];
});
});
};
CSSWorker.prototype.doRename = function (uri, position, newName) {
var document = this._getTextDocument(uri);
var stylesheet = this._languageService.parseStylesheet(document);
var renames = this._languageService.doRename(document, position, newName, stylesheet);
return Promise.resolve(renames);
return __awaiter(this, void 0, void 0, function () {
var document, stylesheet, renames;
return __generator(this, function (_a) {
document = this._getTextDocument(uri);
stylesheet = this._languageService.parseStylesheet(document);
renames = this._languageService.doRename(document, position, newName, stylesheet);
return [2 /*return*/, Promise.resolve(renames)];
});
});
};

@@ -110,0 +210,0 @@ CSSWorker.prototype._getTextDocument = function (uri) {

@@ -0,0 +0,0 @@ /*---------------------------------------------------------------------------------------------

@@ -5,6 +5,4 @@ /*---------------------------------------------------------------------------------------------

*--------------------------------------------------------------------------------------------*/
'use strict';
import * as cssService from './_deps/vscode-css-languageservice/cssLanguageService';
var Uri = monaco.Uri;
var Range = monaco.Range;
import { languages, editor, Uri, Range, MarkerSeverity } from './fillers/monaco-editor-core';
// --- diagnostics --- ---

@@ -31,3 +29,3 @@ var DiagnosticsAdapter = /** @class */ (function () {

var onModelRemoved = function (model) {
monaco.editor.setModelMarkers(model, _this._languageId, []);
editor.setModelMarkers(model, _this._languageId, []);
var uriStr = model.uri.toString();

@@ -40,5 +38,5 @@ var listener = _this._listener[uriStr];

};
this._disposables.push(monaco.editor.onDidCreateModel(onModelAdd));
this._disposables.push(monaco.editor.onWillDisposeModel(onModelRemoved));
this._disposables.push(monaco.editor.onDidChangeModelLanguage(function (event) {
this._disposables.push(editor.onDidCreateModel(onModelAdd));
this._disposables.push(editor.onWillDisposeModel(onModelRemoved));
this._disposables.push(editor.onDidChangeModelLanguage(function (event) {
onModelRemoved(event.model);

@@ -48,3 +46,3 @@ onModelAdd(event.model);

defaults.onDidChange(function (_) {
monaco.editor.getModels().forEach(function (model) {
editor.getModels().forEach(function (model) {
if (model.getModeId() === _this._languageId) {

@@ -63,3 +61,3 @@ onModelRemoved(model);

});
monaco.editor.getModels().forEach(onModelAdd);
editor.getModels().forEach(onModelAdd);
}

@@ -71,11 +69,14 @@ DiagnosticsAdapter.prototype.dispose = function () {

DiagnosticsAdapter.prototype._doValidate = function (resource, languageId) {
this._worker(resource).then(function (worker) {
this._worker(resource)
.then(function (worker) {
return worker.doValidation(resource.toString());
}).then(function (diagnostics) {
})
.then(function (diagnostics) {
var markers = diagnostics.map(function (d) { return toDiagnostics(resource, d); });
var model = monaco.editor.getModel(resource);
var model = editor.getModel(resource);
if (model.getModeId() === languageId) {
monaco.editor.setModelMarkers(model, languageId, markers);
editor.setModelMarkers(model, languageId, markers);
}
}).then(undefined, function (err) {
})
.then(undefined, function (err) {
console.error(err);

@@ -89,8 +90,12 @@ });

switch (lsSeverity) {
case cssService.DiagnosticSeverity.Error: return monaco.MarkerSeverity.Error;
case cssService.DiagnosticSeverity.Warning: return monaco.MarkerSeverity.Warning;
case cssService.DiagnosticSeverity.Information: return monaco.MarkerSeverity.Info;
case cssService.DiagnosticSeverity.Hint: return monaco.MarkerSeverity.Hint;
case cssService.DiagnosticSeverity.Error:
return MarkerSeverity.Error;
case cssService.DiagnosticSeverity.Warning:
return MarkerSeverity.Warning;
case cssService.DiagnosticSeverity.Information:
return MarkerSeverity.Info;
case cssService.DiagnosticSeverity.Hint:
return MarkerSeverity.Hint;
default:
return monaco.MarkerSeverity.Info;
return MarkerSeverity.Info;
}

@@ -122,3 +127,9 @@ }

}
return { start: { line: range.startLineNumber - 1, character: range.startColumn - 1 }, end: { line: range.endLineNumber - 1, character: range.endColumn - 1 } };
return {
start: {
line: range.startLineNumber - 1,
character: range.startColumn - 1
},
end: { line: range.endLineNumber - 1, character: range.endColumn - 1 }
};
}

@@ -129,25 +140,47 @@ function toRange(range) {

}
return new monaco.Range(range.start.line + 1, range.start.character + 1, range.end.line + 1, range.end.character + 1);
return new Range(range.start.line + 1, range.start.character + 1, range.end.line + 1, range.end.character + 1);
}
function isInsertReplaceEdit(edit) {
return (typeof edit.insert !== 'undefined' &&
typeof edit.replace !== 'undefined');
}
function toCompletionItemKind(kind) {
var mItemKind = monaco.languages.CompletionItemKind;
var mItemKind = languages.CompletionItemKind;
switch (kind) {
case cssService.CompletionItemKind.Text: return mItemKind.Text;
case cssService.CompletionItemKind.Method: return mItemKind.Method;
case cssService.CompletionItemKind.Function: return mItemKind.Function;
case cssService.CompletionItemKind.Constructor: return mItemKind.Constructor;
case cssService.CompletionItemKind.Field: return mItemKind.Field;
case cssService.CompletionItemKind.Variable: return mItemKind.Variable;
case cssService.CompletionItemKind.Class: return mItemKind.Class;
case cssService.CompletionItemKind.Interface: return mItemKind.Interface;
case cssService.CompletionItemKind.Module: return mItemKind.Module;
case cssService.CompletionItemKind.Property: return mItemKind.Property;
case cssService.CompletionItemKind.Unit: return mItemKind.Unit;
case cssService.CompletionItemKind.Value: return mItemKind.Value;
case cssService.CompletionItemKind.Enum: return mItemKind.Enum;
case cssService.CompletionItemKind.Keyword: return mItemKind.Keyword;
case cssService.CompletionItemKind.Snippet: return mItemKind.Snippet;
case cssService.CompletionItemKind.Color: return mItemKind.Color;
case cssService.CompletionItemKind.File: return mItemKind.File;
case cssService.CompletionItemKind.Reference: return mItemKind.Reference;
case cssService.CompletionItemKind.Text:
return mItemKind.Text;
case cssService.CompletionItemKind.Method:
return mItemKind.Method;
case cssService.CompletionItemKind.Function:
return mItemKind.Function;
case cssService.CompletionItemKind.Constructor:
return mItemKind.Constructor;
case cssService.CompletionItemKind.Field:
return mItemKind.Field;
case cssService.CompletionItemKind.Variable:
return mItemKind.Variable;
case cssService.CompletionItemKind.Class:
return mItemKind.Class;
case cssService.CompletionItemKind.Interface:
return mItemKind.Interface;
case cssService.CompletionItemKind.Module:
return mItemKind.Module;
case cssService.CompletionItemKind.Property:
return mItemKind.Property;
case cssService.CompletionItemKind.Unit:
return mItemKind.Unit;
case cssService.CompletionItemKind.Value:
return mItemKind.Value;
case cssService.CompletionItemKind.Enum:
return mItemKind.Enum;
case cssService.CompletionItemKind.Keyword:
return mItemKind.Keyword;
case cssService.CompletionItemKind.Snippet:
return mItemKind.Snippet;
case cssService.CompletionItemKind.Color:
return mItemKind.Color;
case cssService.CompletionItemKind.File:
return mItemKind.File;
case cssService.CompletionItemKind.Reference:
return mItemKind.Reference;
}

@@ -173,3 +206,3 @@ return mItemKind.Property;

},
enumerable: true,
enumerable: false,
configurable: true

@@ -179,5 +212,7 @@ });

var resource = model.uri;
return this._worker(resource).then(function (worker) {
return this._worker(resource)
.then(function (worker) {
return worker.doComplete(resource.toString(), fromPosition(position));
}).then(function (info) {
})
.then(function (info) {
if (!info) {

@@ -197,6 +232,14 @@ return;

range: wordRange,
kind: toCompletionItemKind(entry.kind),
kind: toCompletionItemKind(entry.kind)
};
if (entry.textEdit) {
item.range = toRange(entry.textEdit.range);
if (isInsertReplaceEdit(entry.textEdit)) {
item.range = {
insert: toRange(entry.textEdit.insert),
replace: toRange(entry.textEdit.replace)
};
}
else {
item.range = toRange(entry.textEdit.range);
}
item.insertText = entry.textEdit.newText;

@@ -208,3 +251,4 @@ }

if (entry.insertTextFormat === cssService.InsertTextFormat.Snippet) {
item.insertTextRules = monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet;
item.insertTextRules =
languages.CompletionItemInsertTextRule.InsertAsSnippet;
}

@@ -223,3 +267,5 @@ return item;

function isMarkupContent(thing) {
return thing && typeof thing === 'object' && typeof thing.kind === 'string';
return (thing &&
typeof thing === 'object' &&
typeof thing.kind === 'string');
}

@@ -260,5 +306,7 @@ function toMarkdownString(entry) {

var resource = model.uri;
return this._worker(resource).then(function (worker) {
return this._worker(resource)
.then(function (worker) {
return worker.doHover(resource.toString(), fromPosition(position));
}).then(function (info) {
})
.then(function (info) {
if (!info) {

@@ -279,7 +327,10 @@ return;

switch (kind) {
case cssService.DocumentHighlightKind.Read: return monaco.languages.DocumentHighlightKind.Read;
case cssService.DocumentHighlightKind.Write: return monaco.languages.DocumentHighlightKind.Write;
case cssService.DocumentHighlightKind.Text: return monaco.languages.DocumentHighlightKind.Text;
case cssService.DocumentHighlightKind.Read:
return languages.DocumentHighlightKind.Read;
case cssService.DocumentHighlightKind.Write:
return languages.DocumentHighlightKind.Write;
case cssService.DocumentHighlightKind.Text:
return languages.DocumentHighlightKind.Text;
}
return monaco.languages.DocumentHighlightKind.Text;
return languages.DocumentHighlightKind.Text;
}

@@ -292,5 +343,7 @@ var DocumentHighlightAdapter = /** @class */ (function () {

var resource = model.uri;
return this._worker(resource).then(function (worker) {
return this._worker(resource)
.then(function (worker) {
return worker.findDocumentHighlights(resource.toString(), fromPosition(position));
}).then(function (entries) {
})
.then(function (entries) {
if (!entries) {

@@ -323,5 +376,7 @@ return;

var resource = model.uri;
return this._worker(resource).then(function (worker) {
return this._worker(resource)
.then(function (worker) {
return worker.findDefinition(resource.toString(), fromPosition(position));
}).then(function (definition) {
})
.then(function (definition) {
if (!definition) {

@@ -343,5 +398,7 @@ return;

var resource = model.uri;
return this._worker(resource).then(function (worker) {
return this._worker(resource)
.then(function (worker) {
return worker.findReferences(resource.toString(), fromPosition(position));
}).then(function (entries) {
})
.then(function (entries) {
if (!entries) {

@@ -364,3 +421,3 @@ return;

var _uri = Uri.parse(uri);
// let edits: monaco.languages.TextEdit[] = [];
// let edits: languages.TextEdit[] = [];
for (var _i = 0, _a = edit.changes[uri]; _i < _a.length; _i++) {

@@ -387,5 +444,7 @@ var e = _a[_i];

var resource = model.uri;
return this._worker(resource).then(function (worker) {
return this._worker(resource)
.then(function (worker) {
return worker.doRename(resource.toString(), fromPosition(position), newName);
}).then(function (edit) {
})
.then(function (edit) {
return toWorkspaceEdit(edit);

@@ -399,22 +458,40 @@ });

function toSymbolKind(kind) {
var mKind = monaco.languages.SymbolKind;
var mKind = languages.SymbolKind;
switch (kind) {
case cssService.SymbolKind.File: return mKind.Array;
case cssService.SymbolKind.Module: return mKind.Module;
case cssService.SymbolKind.Namespace: return mKind.Namespace;
case cssService.SymbolKind.Package: return mKind.Package;
case cssService.SymbolKind.Class: return mKind.Class;
case cssService.SymbolKind.Method: return mKind.Method;
case cssService.SymbolKind.Property: return mKind.Property;
case cssService.SymbolKind.Field: return mKind.Field;
case cssService.SymbolKind.Constructor: return mKind.Constructor;
case cssService.SymbolKind.Enum: return mKind.Enum;
case cssService.SymbolKind.Interface: return mKind.Interface;
case cssService.SymbolKind.Function: return mKind.Function;
case cssService.SymbolKind.Variable: return mKind.Variable;
case cssService.SymbolKind.Constant: return mKind.Constant;
case cssService.SymbolKind.String: return mKind.String;
case cssService.SymbolKind.Number: return mKind.Number;
case cssService.SymbolKind.Boolean: return mKind.Boolean;
case cssService.SymbolKind.Array: return mKind.Array;
case cssService.SymbolKind.File:
return mKind.Array;
case cssService.SymbolKind.Module:
return mKind.Module;
case cssService.SymbolKind.Namespace:
return mKind.Namespace;
case cssService.SymbolKind.Package:
return mKind.Package;
case cssService.SymbolKind.Class:
return mKind.Class;
case cssService.SymbolKind.Method:
return mKind.Method;
case cssService.SymbolKind.Property:
return mKind.Property;
case cssService.SymbolKind.Field:
return mKind.Field;
case cssService.SymbolKind.Constructor:
return mKind.Constructor;
case cssService.SymbolKind.Enum:
return mKind.Enum;
case cssService.SymbolKind.Interface:
return mKind.Interface;
case cssService.SymbolKind.Function:
return mKind.Function;
case cssService.SymbolKind.Variable:
return mKind.Variable;
case cssService.SymbolKind.Constant:
return mKind.Constant;
case cssService.SymbolKind.String:
return mKind.String;
case cssService.SymbolKind.Number:
return mKind.Number;
case cssService.SymbolKind.Boolean:
return mKind.Boolean;
case cssService.SymbolKind.Array:
return mKind.Array;
}

@@ -429,3 +506,5 @@ return mKind.Function;

var resource = model.uri;
return this._worker(resource).then(function (worker) { return worker.findDocumentSymbols(resource.toString()); }).then(function (items) {
return this._worker(resource)
.then(function (worker) { return worker.findDocumentSymbols(resource.toString()); })
.then(function (items) {
if (!items) {

@@ -454,3 +533,5 @@ return;

var resource = model.uri;
return this._worker(resource).then(function (worker) { return worker.findDocumentColors(resource.toString()); }).then(function (infos) {
return this._worker(resource)
.then(function (worker) { return worker.findDocumentColors(resource.toString()); })
.then(function (infos) {
if (!infos) {

@@ -467,3 +548,7 @@ return;

var resource = model.uri;
return this._worker(resource).then(function (worker) { return worker.getColorPresentations(resource.toString(), info.color, fromRange(info.range)); }).then(function (presentations) {
return this._worker(resource)
.then(function (worker) {
return worker.getColorPresentations(resource.toString(), info.color, fromRange(info.range));
})
.then(function (presentations) {
if (!presentations) {

@@ -474,3 +559,3 @@ return;

var item = {
label: presentation.label,
label: presentation.label
};

@@ -496,3 +581,5 @@ if (presentation.textEdit) {

var resource = model.uri;
return this._worker(resource).then(function (worker) { return worker.getFoldingRanges(resource.toString(), context); }).then(function (ranges) {
return this._worker(resource)
.then(function (worker) { return worker.getFoldingRanges(resource.toString(), context); })
.then(function (ranges) {
if (!ranges) {

@@ -518,5 +605,8 @@ return;

switch (kind) {
case cssService.FoldingRangeKind.Comment: return monaco.languages.FoldingRangeKind.Comment;
case cssService.FoldingRangeKind.Imports: return monaco.languages.FoldingRangeKind.Imports;
case cssService.FoldingRangeKind.Region: return monaco.languages.FoldingRangeKind.Region;
case cssService.FoldingRangeKind.Comment:
return languages.FoldingRangeKind.Comment;
case cssService.FoldingRangeKind.Imports:
return languages.FoldingRangeKind.Imports;
case cssService.FoldingRangeKind.Region:
return languages.FoldingRangeKind.Region;
}

@@ -530,3 +620,7 @@ }

var resource = model.uri;
return this._worker(resource).then(function (worker) { return worker.getSelectionRanges(resource.toString(), positions.map(fromPosition)); }).then(function (selectionRanges) {
return this._worker(resource)
.then(function (worker) {
return worker.getSelectionRanges(resource.toString(), positions.map(fromPosition));
})
.then(function (selectionRanges) {
if (!selectionRanges) {

@@ -533,0 +627,0 @@ return;

@@ -5,4 +5,3 @@ /*---------------------------------------------------------------------------------------------

*--------------------------------------------------------------------------------------------*/
'use strict';
var Emitter = monaco.Emitter;
import { languages, Emitter } from './fillers/monaco-editor-core';
// --- CSS configuration and defaults ---------

@@ -20,3 +19,3 @@ var LanguageServiceDefaultsImpl = /** @class */ (function () {

},
enumerable: true,
enumerable: false,
configurable: true

@@ -28,3 +27,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -36,3 +35,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -44,3 +43,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -56,6 +55,4 @@ });

};
;
return LanguageServiceDefaultsImpl;
}());
export { LanguageServiceDefaultsImpl };
var diagnosticDefault = {

@@ -97,14 +94,7 @@ validate: true,

};
var cssDefaults = new LanguageServiceDefaultsImpl('css', diagnosticDefault, modeConfigurationDefault);
var scssDefaults = new LanguageServiceDefaultsImpl('scss', diagnosticDefault, modeConfigurationDefault);
var lessDefaults = new LanguageServiceDefaultsImpl('less', diagnosticDefault, modeConfigurationDefault);
// Export API
function createAPI() {
return {
cssDefaults: cssDefaults,
lessDefaults: lessDefaults,
scssDefaults: scssDefaults
};
}
monaco.languages.css = createAPI();
export var cssDefaults = new LanguageServiceDefaultsImpl('css', diagnosticDefault, modeConfigurationDefault);
export var scssDefaults = new LanguageServiceDefaultsImpl('scss', diagnosticDefault, modeConfigurationDefault);
export var lessDefaults = new LanguageServiceDefaultsImpl('less', diagnosticDefault, modeConfigurationDefault);
// export to the global based API
languages.json = { cssDefaults: cssDefaults, lessDefaults: lessDefaults, scssDefaults: scssDefaults };
// --- Registration to monaco editor ---

@@ -114,10 +104,10 @@ function getMode() {

}
monaco.languages.onLanguage('less', function () {
languages.onLanguage('less', function () {
getMode().then(function (mode) { return mode.setupMode(lessDefaults); });
});
monaco.languages.onLanguage('scss', function () {
languages.onLanguage('scss', function () {
getMode().then(function (mode) { return mode.setupMode(scssDefaults); });
});
monaco.languages.onLanguage('css', function () {
languages.onLanguage('css', function () {
getMode().then(function (mode) { return mode.setupMode(cssDefaults); });
});

@@ -5,3 +5,3 @@ /*---------------------------------------------------------------------------------------------

*--------------------------------------------------------------------------------------------*/
'use strict';
import { editor } from './fillers/monaco-editor-core';
var STOP_WHEN_IDLE_FOR = 2 * 60 * 1000; // 2min

@@ -15,3 +15,5 @@ var WorkerManager = /** @class */ (function () {

this._lastUsedTime = 0;
this._configChangeListener = this._defaults.onDidChange(function () { return _this._stopWorker(); });
this._configChangeListener = this._defaults.onDidChange(function () {
return _this._stopWorker();
});
}

@@ -42,3 +44,3 @@ WorkerManager.prototype._stopWorker = function () {

if (!this._client) {
this._worker = monaco.editor.createWebWorker({
this._worker = editor.createWebWorker({
// module that exports the create() method and returns a `CSSWorker` instance

@@ -64,7 +66,10 @@ moduleId: 'vs/language/css/cssWorker',

var _client;
return this._getClient().then(function (client) {
return this._getClient()
.then(function (client) {
_client = client;
}).then(function (_) {
})
.then(function (_) {
return _this._worker.withSyncedResources(resources);
}).then(function (_) { return _client; });
})
.then(function (_) { return _client; });
};

@@ -71,0 +76,0 @@ return WorkerManager;

/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* monaco-css version: 2.7.0(cbf1d6a12b013bb7e773531de7b4f30989e6e4d7)
* monaco-css version: 3.0.0(e77dc655b9e447c3e61d09bd9e05640531b71761)
* Released under the MIT license
* https://github.com/Microsoft/monaco-css/blob/master/LICENSE.md
*-----------------------------------------------------------------------------*/
define("vs/language/css/monaco.contribution",["require","exports"],(function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=monaco.Emitter,t=function(){function e(e,n,t){this._onDidChange=new o,this._languageId=e,this.setDiagnosticsOptions(n),this.setModeConfiguration(t)}return Object.defineProperty(e.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"modeConfiguration",{get:function(){return this._modeConfiguration},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"diagnosticsOptions",{get:function(){return this._diagnosticsOptions},enumerable:!0,configurable:!0}),e.prototype.setDiagnosticsOptions=function(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)},e.prototype.setModeConfiguration=function(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)},e}();n.LanguageServiceDefaultsImpl=t;var i={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"}},r={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},s=new t("css",i,r),a=new t("scss",i,r),u=new t("less",i,r);function g(){return new Promise((function(n,o){e(["./cssMode"],n,o)}))}monaco.languages.css={cssDefaults:s,lessDefaults:u,scssDefaults:a},monaco.languages.onLanguage("less",(function(){g().then((function(e){return e.setupMode(u)}))})),monaco.languages.onLanguage("scss",(function(){g().then((function(e){return e.setupMode(a)}))})),monaco.languages.onLanguage("css",(function(){g().then((function(e){return e.setupMode(s)}))}))}));
define("vs/language/css/fillers/monaco-editor-core",[],(function(){return self.monaco})),define("vs/language/css/monaco.contribution",["require","exports","./fillers/monaco-editor-core"],(function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.lessDefaults=n.scssDefaults=n.cssDefaults=void 0;var o=function(){function e(e,n,o){this._onDidChange=new t.Emitter,this._languageId=e,this.setDiagnosticsOptions(n),this.setModeConfiguration(o)}return Object.defineProperty(e.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"modeConfiguration",{get:function(){return this._modeConfiguration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"diagnosticsOptions",{get:function(){return this._diagnosticsOptions},enumerable:!1,configurable:!0}),e.prototype.setDiagnosticsOptions=function(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)},e.prototype.setModeConfiguration=function(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)},e}(),s={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"}},i={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0};function r(){return new Promise((function(n,t){e(["./cssMode"],n,t)}))}n.cssDefaults=new o("css",s,i),n.scssDefaults=new o("scss",s,i),n.lessDefaults=new o("less",s,i),t.languages.json={cssDefaults:n.cssDefaults,lessDefaults:n.lessDefaults,scssDefaults:n.scssDefaults},t.languages.onLanguage("less",(function(){r().then((function(e){return e.setupMode(n.lessDefaults)}))})),t.languages.onLanguage("scss",(function(){r().then((function(e){return e.setupMode(n.scssDefaults)}))})),t.languages.onLanguage("css",(function(){r().then((function(e){return e.setupMode(n.cssDefaults)}))}))}));

@@ -5,27 +5,29 @@ /*---------------------------------------------------------------------------------------------

*--------------------------------------------------------------------------------------------*/
declare module monaco.languages.css {
/// <reference path="node_modules/monaco-editor-core/monaco.d.ts" />
declare namespace monaco.languages.css {
export interface DiagnosticsOptions {
readonly validate?: boolean;
readonly lint?: {
readonly compatibleVendorPrefixes?: 'ignore' | 'warning' | 'error',
readonly vendorPrefix?: 'ignore' | 'warning' | 'error',
readonly duplicateProperties?: 'ignore' | 'warning' | 'error',
readonly emptyRules?: 'ignore' | 'warning' | 'error',
readonly importStatement?: 'ignore' | 'warning' | 'error',
readonly boxModel?: 'ignore' | 'warning' | 'error',
readonly universalSelector?: 'ignore' | 'warning' | 'error',
readonly zeroUnits?: 'ignore' | 'warning' | 'error',
readonly fontFaceProperties?: 'ignore' | 'warning' | 'error',
readonly hexColorLength?: 'ignore' | 'warning' | 'error',
readonly argumentsInColorFunction?: 'ignore' | 'warning' | 'error',
readonly unknownProperties?: 'ignore' | 'warning' | 'error',
readonly ieHack?: 'ignore' | 'warning' | 'error',
readonly unknownVendorSpecificProperties?: 'ignore' | 'warning' | 'error',
readonly propertyIgnoredDueToDisplay?: 'ignore' | 'warning' | 'error',
readonly important?: 'ignore' | 'warning' | 'error',
readonly float?: 'ignore' | 'warning' | 'error',
readonly idSelector?: 'ignore' | 'warning' | 'error'
}
readonly compatibleVendorPrefixes?: 'ignore' | 'warning' | 'error';
readonly vendorPrefix?: 'ignore' | 'warning' | 'error';
readonly duplicateProperties?: 'ignore' | 'warning' | 'error';
readonly emptyRules?: 'ignore' | 'warning' | 'error';
readonly importStatement?: 'ignore' | 'warning' | 'error';
readonly boxModel?: 'ignore' | 'warning' | 'error';
readonly universalSelector?: 'ignore' | 'warning' | 'error';
readonly zeroUnits?: 'ignore' | 'warning' | 'error';
readonly fontFaceProperties?: 'ignore' | 'warning' | 'error';
readonly hexColorLength?: 'ignore' | 'warning' | 'error';
readonly argumentsInColorFunction?: 'ignore' | 'warning' | 'error';
readonly unknownProperties?: 'ignore' | 'warning' | 'error';
readonly ieHack?: 'ignore' | 'warning' | 'error';
readonly unknownVendorSpecificProperties?: 'ignore' | 'warning' | 'error';
readonly propertyIgnoredDueToDisplay?: 'ignore' | 'warning' | 'error';
readonly important?: 'ignore' | 'warning' | 'error';
readonly float?: 'ignore' | 'warning' | 'error';
readonly idSelector?: 'ignore' | 'warning' | 'error';
};
}
export interface ModeConfiguration {

@@ -36,3 +38,2 @@ /**

readonly completionItems?: boolean;
/**

@@ -42,3 +43,2 @@ * Defines whether the built-in hoverProvider is enabled.

readonly hovers?: boolean;
/**

@@ -48,3 +48,2 @@ * Defines whether the built-in documentSymbolProvider is enabled.

readonly documentSymbols?: boolean;
/**

@@ -54,3 +53,2 @@ * Defines whether the built-in definitions provider is enabled.

readonly definitions?: boolean;
/**

@@ -60,3 +58,2 @@ * Defines whether the built-in references provider is enabled.

readonly references?: boolean;
/**

@@ -66,3 +63,2 @@ * Defines whether the built-in references provider is enabled.

readonly documentHighlights?: boolean;
/**

@@ -72,3 +68,2 @@ * Defines whether the built-in rename provider is enabled.

readonly rename?: boolean;
/**

@@ -78,3 +73,2 @@ * Defines whether the built-in color provider is enabled.

readonly colors?: boolean;
/**

@@ -84,3 +78,2 @@ * Defines whether the built-in foldingRange provider is enabled.

readonly foldingRanges?: boolean;
/**

@@ -90,3 +83,2 @@ * Defines whether the built-in diagnostic provider is enabled.

readonly diagnostics?: boolean;
/**

@@ -96,6 +88,5 @@ * Defines whether the built-in selection range provider is enabled.

readonly selectionRanges?: boolean;
}
export interface LanguageServiceDefaults {
readonly languageId: string;
readonly onDidChange: IEvent<LanguageServiceDefaults>;

@@ -107,6 +98,5 @@ readonly diagnosticsOptions: DiagnosticsOptions;

}
export var cssDefaults: LanguageServiceDefaults;
export var lessDefaults: LanguageServiceDefaults;
export var scssDefaults: LanguageServiceDefaults;
}
export const cssDefaults: LanguageServiceDefaults;
export const scssDefaults: LanguageServiceDefaults;
export const lessDefaults: LanguageServiceDefaults;
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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