Skip to content

Commit d292c08

Browse files
authored
[TASK] Revise TypoScript code highlighting (#210)
- Remove highlighting of functions - Remove highlighting of keys in function references - Add highlighting of EXT: and FILE:EXT: paths
1 parent 1a69506 commit d292c08

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

packages/typo3-docs-theme/resources/languages/typoscript.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
"case_insensitive": false,
66
"keywords": "ADJUST BOX CASE COA COA_INT CONTENT CROP EFFECT ELLIPSE EMBOSS EXTBASEPLUGIN FILES FLUIDTEMPLATE HMENU IMAGE IMG_RESOURCE LOAD_REGISTER OUTLINE PAGE RECORDS RESTORE_REGISTER SCALE SHADOW SVG TEXT TMENU TMENUITEM USER USER_INT WORKAREA",
77
"contains": [
8+
{
9+
"__comment": "EXT: paths: `EXT:my_extension/Configuration/TypoScript/bar.typoscript` or `FILE:EXT:my_extension/Configuration/TypoScript/myMenu.typoscript`",
10+
"className": "bullet",
11+
"begin": "(FILE:)?EXT:[A-Za-z0-9_\\-\\/\\.]+"
12+
},
813
{
914
"__comment": "One-line comment: `# Some comment` or `10 = TEXT # Some comment`",
1015
"className": "comment",
@@ -38,21 +43,6 @@
3843
"className": "title",
3944
"begin": "\\b[1-9][0-9]*(?=\\s?\\{)"
4045
},
41-
{
42-
"__comment": "Functions: `.stdWrap`",
43-
"className": "symbol",
44-
"begin": "(?<=\\.)[A-Za-z][A-Za-z0-9_]+"
45-
},
46-
{
47-
"__comment": "Functions: ` stdWrap =` or ` stdWrap {`",
48-
"className": "symbol",
49-
"begin": "(?<=[\\s{2,}])[A-Za-z][A-Za-z0-9_]+(?=\\s?[\\=|\\{])"
50-
},
51-
{
52-
"__comment": "Key in function references: `data = date : U` (date)",
53-
"className": "name",
54-
"begin": "(?<=\\=\\s)[a-zA-Z]+(?=\\s\\:)"
55-
},
5646
{
5747
"__comment": "Condition: `[date(\"j\") == 9]`",
5848
"className": "meta",
@@ -62,14 +52,24 @@
6252
{
6353
"__comment": "Import: `@import 'EXT:my_extension/Configuration/TypoScript/bar.typoscript'`",
6454
"className": "name",
65-
"begin": "@import",
66-
"end": "$"
55+
"begin": "@import ['\"]",
56+
"end": "['\"]$",
57+
"contains": [
58+
{
59+
"$ref": "#contains.0"
60+
}
61+
]
6762
},
6863
{
6964
"__comment": "Import: `<INCLUDE_TYPOSCRIPT: source=\"FILE:EXT:my_extension/Configuration/TypoScript/myMenu.typoscript\">`",
7065
"className": "name",
7166
"begin": "<INCLUDE_TYPOSCRIPT:",
72-
"end": "$"
67+
"end": "$",
68+
"contains": [
69+
{
70+
"$ref": "#contains.0"
71+
}
72+
]
7373
},
7474
{
7575
"__comment": "An ordinary number",

0 commit comments

Comments
 (0)