vscode-css-languageservice
Advanced tools
Comparing version 3.0.6 to 3.0.7
@@ -44,3 +44,4 @@ var __extends = (this && this.__extends) || (function () { | ||
|| _super.prototype._parseStylesheetStatement.call(this) | ||
|| this._parseVariableDeclaration(); | ||
|| this._parseVariableDeclaration() | ||
|| this._parsePlugin(); | ||
}; | ||
@@ -75,2 +76,16 @@ LESSParser.prototype._parseImport = function () { | ||
}; | ||
LESSParser.prototype._parsePlugin = function () { | ||
if (!this.peekKeyword('@plugin')) { | ||
return null; | ||
} | ||
var node = this.createNode(nodes.NodeType.Plugin); | ||
this.consumeToken(); // @import | ||
if (!node.addChild(this._parseStringLiteral())) { | ||
return this.finish(node, cssErrors_1.ParseError.StringLiteralExpected); | ||
} | ||
if (!this.accept(cssScanner_1.TokenType.SemiColon)) { | ||
return this.finish(node, cssErrors_1.ParseError.SemiColonExpected); | ||
} | ||
return this.finish(node); | ||
}; | ||
LESSParser.prototype._parseMediaQuery = function (resyncStopToken) { | ||
@@ -77,0 +92,0 @@ var node = _super.prototype._parseMediaQuery.call(this, resyncStopToken); |
@@ -531,2 +531,3 @@ var __extends = (this && this.__extends) || (function () { | ||
if (node.setValue(this._parseExpr(true))) { | ||
this.accept(scssScanner.Ellipsis); // #43746 | ||
node.addChild(this._parsePrio()); // #9859 | ||
@@ -533,0 +534,0 @@ return this.finish(node); |
@@ -62,4 +62,10 @@ (function (factory) { | ||
else if (node instanceof nodes.SimpleSelector) { | ||
var parentRuleSet = node.findParent(nodes.NodeType.Ruleset); | ||
this.getCompletionsForSelector(parentRuleSet, parentRuleSet.isNested(), result); | ||
var parentExtRef = node.findParent(nodes.NodeType.ExtendsReference); | ||
if (parentExtRef) { | ||
this.getCompletionsForExtendsReference(parentExtRef, node, result); | ||
} | ||
else { | ||
var parentRuleSet = node.findParent(nodes.NodeType.Ruleset); | ||
this.getCompletionsForSelector(parentRuleSet, parentRuleSet && parentRuleSet.isNested(), result); | ||
} | ||
} | ||
@@ -96,2 +102,5 @@ else if (node instanceof nodes.FunctionArgument) { | ||
} | ||
else if (node instanceof nodes.ExtendsReference) { | ||
this.getCompletionsForExtendsReference(node, null, result); | ||
} | ||
if (result.items.length > 0) { | ||
@@ -686,2 +695,5 @@ return this.finalize(result); | ||
} | ||
else if (node instanceof nodes.ExtendsReference) { | ||
this.getCompletionsForExtendsReference(node, null, result); | ||
} | ||
return result; | ||
@@ -796,2 +808,5 @@ }; | ||
}; | ||
CSSCompletion.prototype.getCompletionsForExtendsReference = function (extendsRef, existingNode, result) { | ||
return result; | ||
}; | ||
return CSSCompletion; | ||
@@ -798,0 +813,0 @@ }()); |
@@ -17,3 +17,3 @@ var __extends = (this && this.__extends) || (function () { | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports", "./cssCompletion", "vscode-languageserver-types", "vscode-nls"], factory); | ||
define(["require", "exports", "./cssCompletion", "../parser/cssNodes", "vscode-languageserver-types", "vscode-nls"], factory); | ||
} | ||
@@ -28,2 +28,3 @@ })(function (require, exports) { | ||
var cssCompletion_1 = require("./cssCompletion"); | ||
var nodes = require("../parser/cssNodes"); | ||
var vscode_languageserver_types_1 = require("vscode-languageserver-types"); | ||
@@ -83,2 +84,15 @@ var nls = require("vscode-nls"); | ||
}; | ||
SCSSCompletion.prototype.getCompletionsForExtendsReference = function (extendsRef, existingNode, result) { | ||
var symbols = this.getSymbolContext().findSymbolsAtOffset(this.offset, nodes.ReferenceType.Rule); | ||
for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) { | ||
var symbol = symbols_1[_i]; | ||
var suggest = { | ||
label: symbol.name, | ||
textEdit: vscode_languageserver_types_1.TextEdit.replace(this.getCompletionRange(existingNode), symbol.name), | ||
kind: vscode_languageserver_types_1.CompletionItemKind.Function, | ||
}; | ||
result.items.push(suggest); | ||
} | ||
return result; | ||
}; | ||
SCSSCompletion.variableDefaults = { | ||
@@ -85,0 +99,0 @@ '$red': '1', |
{ | ||
"name": "vscode-css-languageservice", | ||
"version": "3.0.6", | ||
"version": "3.0.7", | ||
"description": "Language service for CSS, LESS and SCSS", | ||
@@ -5,0 +5,0 @@ "main": "./lib/cssLanguageService.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
814556
21400