vscode-css-languageservice 6.2.13 → 6.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -276,7 +276,7 @@ export class Parser {
276
276
  || this._parseViewPort()
277
277
  || this._parseNamespace()
278
278
  || this._parseDocument()
279
- || this._parseContainer()
279
+ || this._parseContainer(isNested)
280
280
  || this._parseUnknownAtRule();
281
281
  }
282
282
  _tryParseRuleset(isNested) {
@@ -310,6 +310,7 @@ export class Parser {
310
310
  return this._parseMedia(true)
311
311
  || this._parseSupports(true)
312
312
  || this._parseLayer(true)
313
+ || this._parseContainer(true)
313
314
  || this._parseUnknownAtRule();
314
315
  }
315
316
  _parseRuleSetDeclaration() {
@@ -1137,7 +1138,14 @@ export class Parser {
1137
1138
  this.resync([], [TokenType.CurlyL]); // ignore all the rules
1138
1139
  return this._parseBody(node, this._parseStylesheetStatement.bind(this));
1139
1140
  }
1140
- _parseContainer() {
1141
+ _parseContainerDeclaration(isNested = false) {
1142
+ if (isNested) {
1143
+ // if nested, the body can contain rulesets, but also declarations
1144
+ return this._tryParseRuleset(true) || this._tryToParseDeclaration() || this._parseStylesheetStatement(true);
1145
+ }
1146
+ return this._parseStylesheetStatement(false);
1147
+ }
1148
+ _parseContainer(isNested = false) {
1141
1149
  if (!this.peekKeyword('@container')) {
1142
1150
  return null;
1143
1151
  }
@@ -1145,7 +1153,7 @@ export class Parser {
1145
1153
  this.consumeToken(); // @container
1146
1154
  node.addChild(this._parseIdent()); // optional container name
1147
1155
  node.addChild(this._parseContainerQuery());
1148
- return this._parseBody(node, this._parseStylesheetStatement.bind(this));
1156
+ return this._parseBody(node, this._parseContainerDeclaration.bind(this, isNested));
1149
1157
  }
1150
1158
  _parseContainerQuery() {
1151
1159
  // <container-query> = not <query-in-parens>
@@ -274,7 +274,7 @@ export class LESSParser extends cssParser.Parser {
274
274
  || this._parseSupports(true) // @supports
275
275
  || this._parseLayer() // @layer
276
276
  || this._parsePropertyAtRule() // @property
277
- || this._parseContainer() // @container
277
+ || this._parseContainer(true) // @container
278
278
  || this._parseDetachedRuleSetMixin() // less detached ruleset mixin
279
279
  || this._parseVariableDeclaration() // Variable declarations
280
280
  || this._parseRuleSetDeclarationAtStatement();
@@ -219,7 +219,7 @@ export class SCSSParser extends cssParser.Parser {
219
219
  || this._parseSupports(true) // @supports
220
220
  || this._parseLayer() // @layer
221
221
  || this._parsePropertyAtRule() // @property
222
- || this._parseContainer() // @container
222
+ || this._parseContainer(true) // nested @container
223
223
  || this._parseRuleSetDeclarationAtStatement();
224
224
  }
225
225
  return this._parseVariableDeclaration() // variable declaration
@@ -287,7 +287,7 @@
287
287
  || this._parseViewPort()
288
288
  || this._parseNamespace()
289
289
  || this._parseDocument()
290
- || this._parseContainer()
290
+ || this._parseContainer(isNested)
291
291
  || this._parseUnknownAtRule();
292
292
  }
293
293
  _tryParseRuleset(isNested) {
@@ -321,6 +321,7 @@
321
321
  return this._parseMedia(true)
322
322
  || this._parseSupports(true)
323
323
  || this._parseLayer(true)
324
+ || this._parseContainer(true)
324
325
  || this._parseUnknownAtRule();
325
326
  }
326
327
  _parseRuleSetDeclaration() {
@@ -1148,7 +1149,14 @@
1148
1149
  this.resync([], [cssScanner_1.TokenType.CurlyL]); // ignore all the rules
1149
1150
  return this._parseBody(node, this._parseStylesheetStatement.bind(this));
1150
1151
  }
1151
- _parseContainer() {
1152
+ _parseContainerDeclaration(isNested = false) {
1153
+ if (isNested) {
1154
+ // if nested, the body can contain rulesets, but also declarations
1155
+ return this._tryParseRuleset(true) || this._tryToParseDeclaration() || this._parseStylesheetStatement(true);
1156
+ }
1157
+ return this._parseStylesheetStatement(false);
1158
+ }
1159
+ _parseContainer(isNested = false) {
1152
1160
  if (!this.peekKeyword('@container')) {
1153
1161
  return null;
1154
1162
  }
@@ -1156,7 +1164,7 @@
1156
1164
  this.consumeToken(); // @container
1157
1165
  node.addChild(this._parseIdent()); // optional container name
1158
1166
  node.addChild(this._parseContainerQuery());
1159
- return this._parseBody(node, this._parseStylesheetStatement.bind(this));
1167
+ return this._parseBody(node, this._parseContainerDeclaration.bind(this, isNested));
1160
1168
  }
1161
1169
  _parseContainerQuery() {
1162
1170
  // <container-query> = not <query-in-parens>
@@ -285,7 +285,7 @@
285
285
  || this._parseSupports(true) // @supports
286
286
  || this._parseLayer() // @layer
287
287
  || this._parsePropertyAtRule() // @property
288
- || this._parseContainer() // @container
288
+ || this._parseContainer(true) // @container
289
289
  || this._parseDetachedRuleSetMixin() // less detached ruleset mixin
290
290
  || this._parseVariableDeclaration() // Variable declarations
291
291
  || this._parseRuleSetDeclarationAtStatement();
@@ -230,7 +230,7 @@
230
230
  || this._parseSupports(true) // @supports
231
231
  || this._parseLayer() // @layer
232
232
  || this._parsePropertyAtRule() // @property
233
- || this._parseContainer() // @container
233
+ || this._parseContainer(true) // nested @container
234
234
  || this._parseRuleSetDeclarationAtStatement();
235
235
  }
236
236
  return this._parseVariableDeclaration() // variable declaration
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vscode-css-languageservice",
3
- "version": "6.2.13",
3
+ "version": "6.2.14",
4
4
  "description": "Language service for CSS, LESS and SCSS",
5
5
  "main": "./lib/umd/cssLanguageService.js",
6
6
  "typings": "./lib/umd/cssLanguageService",
@@ -17,15 +17,15 @@
17
17
  "devDependencies": {
18
18
  "@types/mocha": "^10.0.6",
19
19
  "@types/node": "16.x",
20
- "@typescript-eslint/eslint-plugin": "^6.21.0",
21
- "@typescript-eslint/parser": "^6.21.0",
20
+ "@typescript-eslint/eslint-plugin": "^7.7.0",
21
+ "@typescript-eslint/parser": "^7.7.0",
22
22
  "@vscode/web-custom-data": "^0.4.9",
23
23
  "eslint": "^8.57.0",
24
24
  "js-beautify": "^1.15.1",
25
- "mocha": "^10.3.0",
25
+ "mocha": "^10.4.0",
26
26
  "rimraf": "^5.0.5",
27
27
  "source-map-support": "^0.5.21",
28
- "typescript": "^5.3.3"
28
+ "typescript": "^5.4.5"
29
29
  },
30
30
  "dependencies": {
31
31
  "@vscode/l10n": "^0.0.18",