diff options
author | bscan <10503608+bscan@users.noreply.github.com> | 2022-11-14 23:00:53 -0500 |
---|---|---|
committer | bscan <10503608+bscan@users.noreply.github.com> | 2022-11-14 23:00:53 -0500 |
commit | e92c085c97395768995e72f5c913f16fa7fab5f9 (patch) | |
tree | 99a651fc296c69e7174967e38429b065069e07ae /syntaxes | |
parent | 50452b502fb0605ffd525b38fc2562d0a50b18d3 (diff) | |
download | PerlNavigator-e92c085c97395768995e72f5c913f16fa7fab5f9.zip |
Additional Moo/Moose packages (e.g. Moo::Role) plus dataclass rename
Diffstat (limited to 'syntaxes')
-rw-r--r-- | syntaxes/dataclass.json (renamed from syntaxes/type-hints.json) | 46 | ||||
-rw-r--r-- | syntaxes/perl-scopes.json | 6 |
2 files changed, 27 insertions, 25 deletions
diff --git a/syntaxes/type-hints.json b/syntaxes/dataclass.json index 95ffb34..c4f63e6 100644 --- a/syntaxes/type-hints.json +++ b/syntaxes/dataclass.json @@ -1,15 +1,11 @@ { "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", - "information_for_contributors": [ - "To modify the grammar, simply update the JSON run the extension. This file detects scope (e.g. is Moo active) and the individual files define the syntax of the scope", - "Code used under MIT license from https://github.com/torrentalle/vscode-perl-typehints" - ], - "name": "typehints", - "scopeName": "source.perl.package.typehints", - "injectionSelector": "L:meta.typehints.perl -comment -string -text", + "name": "dataclass", + "scopeName": "source.perl.package.dataclass", + "injectionSelector": "L:meta.dataclass.perl -comment -string -text", "patterns": [ { - "include": "#typehints" + "include": "#dataclass" }, { "include": "#letblocks" @@ -19,19 +15,19 @@ } ], "repository": { - "typehints": { + "dataclass": { "patterns": [ { "match": "\\b(has|private|public|readonly|lazy|protected|initvar)\\s+(\\w+)\\s*(?::(\\s*\\{[\\s\\|\\w:\\[\\],]+\\}|[\\s\\|\\w:\\[\\]]+))?\\s*(?=[;=])", "captures": { "1": { - "name": "keyword.other.attribute.typehints.perl" + "name": "keyword.other.attribute.dataclass.perl" }, "2": { - "name": "entity.other.attribute-name.typehints.perl" + "name": "entity.other.attribute-name.dataclass.perl" }, "3": { - "name": "support.type.typehints.perl" + "name": "support.type.dataclass.perl" } } }, @@ -39,13 +35,13 @@ "match": "\\b(class)\\s+(\\w+)\\b(?:\\s+(extends)\\s+(\\w+)\\b)?", "captures": { "1": { - "name": "keyword.other.attribute.typehints.perl" + "name": "keyword.other.attribute.dataclass.perl" }, "2": { "name": "entity.name.type.class" }, "3": { - "name": "storage.modifier.typehints.perl" + "name": "storage.modifier.dataclass.perl" }, "4": { "name": "entity.name.type.class" @@ -56,13 +52,13 @@ "match": "\\b(let)\\s+([\\$\\@\\%]\\w+)\\s*(?::(\\s*\\{[\\s\\|\\w:\\[\\],]+\\}|[\\s\\|\\w:\\[\\]]+))?", "captures": { "1": { - "name": "keyword.other.attribute.typehints.perl" + "name": "keyword.other.attribute.dataclass.perl" }, "2": { "name": "variable.other.readwrite.global.perl" }, "3": { - "name": "support.type.typehints.perl" + "name": "support.type.dataclass.perl" } } } @@ -73,7 +69,7 @@ "begin": "\\b(let)\\s+\\(", "beginCaptures": { "0": { - "name": "keyword.other.attribute.typehints.perl" + "name": "keyword.other.attribute.dataclass.perl" } }, "end": "\\)", @@ -90,21 +86,27 @@ "name": "variable.other.readwrite.global.perl" }, "2": { - "name": "support.type.typehints.perl" + "name": "support.type.dataclass.perl" } } } ] - }, + }, "defblocks": { "name": "def.block.typehint", - "begin": "\\b(def)\\s+(\\w+)\\s*\\(", + "begin": "\\b(?:(def)\\s+(\\w+)|(set|get)\\s+(\\w+))\\s*\\(", "beginCaptures": { "1": { "name": "storage.type.sub.perl" }, "2": { "name": "entity.name.function.perl" + }, + "3": { + "name": "storage.type.sub.perl" + }, + "4": { + "name": "variable.other.property.perl" } }, "end": "\\)\\s*(?::(\\s*\\{[\\s\\|\\w:\\[\\],]+\\}|[\\s\\|\\w:\\[\\]]+))?", @@ -113,7 +115,7 @@ "name": "punctuation.definition.block.ts" }, "1": { - "name": "support.type.typehints.perl" + "name": "support.type.dataclass.perl" } }, "patterns": [ @@ -124,7 +126,7 @@ "name": "variable.other.readwrite.global.perl" }, "2": { - "name": "support.type.typehints.perl" + "name": "support.type.dataclass.perl" } } } diff --git a/syntaxes/perl-scopes.json b/syntaxes/perl-scopes.json index a22250a..b1a7f48 100644 --- a/syntaxes/perl-scopes.json +++ b/syntaxes/perl-scopes.json @@ -25,7 +25,7 @@ "patterns": [ { "name": "meta.moose.perl", - "begin": "(?<=use)\\s+(?:Moose|Mouse|Moo)(?=[\\s;])", + "begin": "(?<=use)\\s+(?:Moose|Mouse|Moo)(?=[\\s;]|::)", "end": "(\\b)(?=^\\s*package\\s|no\\s+\\1[\\s;])", "patterns": [ { @@ -44,8 +44,8 @@ ] }, { - "name": "meta.typehints.perl", - "begin": "(?<=use)\\s+(?:Type::Hints)(?=[\\s;])", + "name": "meta.dataclass.perl", + "begin": "(?<=use)\\s+(?:Data::Class)(?=[\\s;])", "patterns": [ { "include": "#source" |