@cssdoc/tmlanguage 0.3.2 → 0.4.0

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.
@@ -7,6 +7,9 @@
7
7
  {
8
8
  "include": "#inline-tag"
9
9
  },
10
+ {
11
+ "include": "#record-tag"
12
+ },
10
13
  {
11
14
  "include": "#modifier-tag"
12
15
  },
@@ -16,6 +19,9 @@
16
19
  {
17
20
  "include": "#property-tag"
18
21
  },
22
+ {
23
+ "include": "#state-tag"
24
+ },
19
25
  {
20
26
  "include": "#structure-tag"
21
27
  },
@@ -55,14 +61,36 @@
55
61
  }
56
62
  ]
57
63
  },
64
+ "record-tag": {
65
+ "match": "(@(?:component|name|utility|rule|declaration))\\b[ \\t]*(\\.?[A-Za-z][A-Za-z0-9_-]*)?",
66
+ "captures": {
67
+ "1": {
68
+ "name": "storage.type.class.cssdoc"
69
+ },
70
+ "2": {
71
+ "name": "entity.name.type.cssdoc"
72
+ }
73
+ }
74
+ },
58
75
  "modifier-tag": {
59
- "match": "(@(?:modifier))\\b[ \\t]*(-[A-Za-z][A-Za-z0-9-]*)?",
76
+ "match": "(@(?:modifier))\\b[ \\t]*(-?[A-Za-z][A-Za-z0-9_-]*)?",
60
77
  "captures": {
61
78
  "1": {
62
79
  "name": "storage.type.class.cssdoc"
63
80
  },
64
81
  "2": {
65
- "name": "variable.other.modifier.cssdoc"
82
+ "name": "entity.other.attribute-name.part.cssdoc"
83
+ }
84
+ }
85
+ },
86
+ "state-tag": {
87
+ "match": "(@(?:cssstate))\\b[ \\t]*(:?[A-Za-z][A-Za-z0-9_-]*(?:\\([A-Za-z0-9_-]*\\))?)?",
88
+ "captures": {
89
+ "1": {
90
+ "name": "storage.type.class.cssdoc"
91
+ },
92
+ "2": {
93
+ "name": "support.type.custom-property.cssdoc"
66
94
  }
67
95
  }
68
96
  },
@@ -78,7 +106,7 @@
78
106
  }
79
107
  },
80
108
  "property-tag": {
81
- "match": "(@(?:cssproperty|property))\\b[ \\t]*(--[A-Za-z][A-Za-z0-9-]*)?",
109
+ "match": "(@(?:cssproperty|property|tokens))\\b[ \\t]*(--[A-Za-z][A-Za-z0-9-]*)?",
82
110
  "captures": {
83
111
  "1": {
84
112
  "name": "storage.type.class.cssdoc"
@@ -89,7 +117,7 @@
89
117
  }
90
118
  },
91
119
  "block-tag": {
92
- "match": "(@(?:component|name|utility|rule|declaration|class|summary|remarks|privateRemarks|deprecated|example|see|since|group|category|defaultValue|cssstate|function|keyframes|animation|layer|container|supports|media|responsive|a11y|accessibility|structure|demo|alpha|beta|experimental|internal|public))\\b",
120
+ "match": "(@(?:class|summary|remarks|privateRemarks|deprecated|example|see|since|group|category|defaultValue|function|keyframes|animation|layer|container|supports|media|responsive|a11y|accessibility|structure|demo|usage|compat|related|alpha|beta|experimental|internal|public))\\b",
93
121
  "name": "storage.type.class.cssdoc"
94
122
  },
95
123
  "structure-tag": {
package/dist/index.mjs CHANGED
@@ -31,10 +31,11 @@ const alt = (names) => names.join("|");
31
31
  */
32
32
  function buildInjectionGrammar() {
33
33
  const inlineTags = alt(cssdocTagNamesByKind("inline"));
34
+ const recordTags = alt(cssdocTagNamesByKind("record"));
34
35
  const modifierTags = alt(cssdocTagNamesByArgument("modifier-name"));
35
36
  const partTags = alt(cssdocTagNamesByArgument("part-name"));
36
37
  const propertyTags = alt(cssdocTagNamesByArgument("custom-property"));
37
- const blockTags = alt(CSSDOC_TAGS.filter((t) => t.kind !== "inline" && !t.argument).map((t) => t.name));
38
+ const blockTags = alt(CSSDOC_TAGS.filter((t) => t.kind !== "inline" && t.kind !== "record" && t.name !== "cssstate" && !t.argument).map((t) => t.name));
38
39
  return {
39
40
  $schema: "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
40
41
  name: "cssdoc",
@@ -42,9 +43,11 @@ function buildInjectionGrammar() {
42
43
  injectionSelector: "L:comment.block.css, L:comment.block.scss, L:comment.block.less",
43
44
  patterns: [
44
45
  { include: "#inline-tag" },
46
+ { include: "#record-tag" },
45
47
  { include: "#modifier-tag" },
46
48
  { include: "#part-tag" },
47
49
  { include: "#property-tag" },
50
+ { include: "#state-tag" },
48
51
  { include: "#structure-tag" },
49
52
  { include: "#block-tag" },
50
53
  { include: "#custom-property" }
@@ -67,11 +70,25 @@ function buildInjectionGrammar() {
67
70
  name: "markup.underline.link.cssdoc"
68
71
  }]
69
72
  },
73
+ "record-tag": {
74
+ match: `(@(?:${recordTags}))\\b[ \\t]*(\\.?[A-Za-z][A-Za-z0-9_-]*)?`,
75
+ captures: {
76
+ "1": { name: TAG_SCOPE },
77
+ "2": { name: "entity.name.type.cssdoc" }
78
+ }
79
+ },
70
80
  "modifier-tag": {
71
- match: `(@(?:${modifierTags}))\\b[ \\t]*(-[A-Za-z][A-Za-z0-9-]*)?`,
81
+ match: `(@(?:${modifierTags}))\\b[ \\t]*(-?[A-Za-z][A-Za-z0-9_-]*)?`,
82
+ captures: {
83
+ "1": { name: TAG_SCOPE },
84
+ "2": { name: "entity.other.attribute-name.part.cssdoc" }
85
+ }
86
+ },
87
+ "state-tag": {
88
+ match: "(@(?:cssstate))\\b[ \\t]*(:?[A-Za-z][A-Za-z0-9_-]*(?:\\([A-Za-z0-9_-]*\\))?)?",
72
89
  captures: {
73
90
  "1": { name: TAG_SCOPE },
74
- "2": { name: "variable.other.modifier.cssdoc" }
91
+ "2": { name: "support.type.custom-property.cssdoc" }
75
92
  }
76
93
  },
77
94
  "part-tag": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cssdoc/tmlanguage",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "A TextMate injection grammar that highlights cssdoc doc-comment tags inside CSS comments, the way TSDoc highlights JSDoc tags. Ships as a Shiki language.",
5
5
  "keywords": [
6
6
  "css",
@@ -33,7 +33,7 @@
33
33
  "access": "public"
34
34
  },
35
35
  "dependencies": {
36
- "@cssdoc/spec": "0.3.2"
36
+ "@cssdoc/spec": "0.4.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/node": "^24.13.3",