Skip to content

Commit 05c71bd

Browse files
raduetsyaeguskov
authored andcommitted
Fix incorrect coloring of the function suffixes - override, private/public, etc
Match all the available keywords, even if there are many of them. The syntax will be checked by the compiler, but the coloring shouldn't break.
1 parent 54a5c54 commit 05c71bd

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

syntaxes/dascript.tmLanguage.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,13 +434,13 @@
434434
},
435435
"function": {
436436
"name": "meta.function.dascript",
437-
"begin": "(def)(\\s+(?:abstract|override)(?:private|public)(?:static))?\\s+(?=[\\w]+\\s*\\()|(\\$)\\s*(?=\\[(?:.*?)\\])|(\\$)\\s*(?=\\()",
437+
"begin": "(def)((?:\\s+(?:abstract|override|private|public|static))*)|(?:(?:\\s+\\S+)*)\\s+(?=[\\w]+\\s*\\()|(\\$)\\s*(?=\\[(?:.*?)\\])|(\\$)\\s*(?=\\()",
438438
"beginCaptures": {
439439
"1": {
440440
"name": "storage.type.function.dascript"
441441
},
442442
"2": {
443-
"name": "storage.type.function.dascript"
443+
"name": "keyword.control.dascript"
444444
},
445445
"3": {
446446
"name": "storage.type.function.dascript"

syntaxes/dascript.tmLanguage.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,12 @@ repository:
234234
- include: $self
235235
function:
236236
name: meta.function.dascript
237-
begin: (def)(\s+(?:abstract|override)(?:private|public)(?:static))?\s+(?=[\w]+\s*\()|(\$)\s*(?=\[(?:.*?)\])|(\$)\s*(?=\()
237+
begin: (def)((?:\s+(?:abstract|override|private|public|static))*)|(?:(?:\s+\S+)*)\s+(?=[\w]+\s*\()|(\$)\s*(?=\[(?:.*?)\])|(\$)\s*(?=\()
238238
beginCaptures:
239239
1:
240240
name: storage.type.function.dascript
241241
2:
242-
name: storage.type.function.dascript
242+
name: keyword.control.dascript
243243
3:
244244
name: storage.type.function.dascript
245245
4:

0 commit comments

Comments
 (0)