From f91b23f070a7704713bd9dc4b015a2b4c4c0c968 Mon Sep 17 00:00:00 2001 From: Real_Marshal Date: Mon, 29 Aug 2022 20:52:56 +0300 Subject: [PATCH] feat: support yarn berry #2 --- syntaxes/yarnlock.tmLanguage.json | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/syntaxes/yarnlock.tmLanguage.json b/syntaxes/yarnlock.tmLanguage.json index 160670b..31ab6b5 100644 --- a/syntaxes/yarnlock.tmLanguage.json +++ b/syntaxes/yarnlock.tmLanguage.json @@ -6,7 +6,8 @@ { "include": "#resolved-url" }, { "include": "#integrity-hashes" }, { "include": "#package-version" }, - { "include": "#keywords" } + { "include": "#keywords" }, + { "include": "#keywords-berry" } ], "repository": { "comments": { @@ -26,7 +27,7 @@ "integrity-hashes": { "patterns": [ { - "begin": "(integrity)\\s+", + "begin": "(integrity|checksum):?\\s+", "beginCaptures": { "1": { "name": "keyword" @@ -46,7 +47,15 @@ "patterns": [ { "name": "keyword", - "match": "\\b(dependencies|integrity|name|optionalDependencies|resolved|version)\\b" + "match": "\\b(dependencies|integrity|name|optionalDependencies|resolved|version)\\b[\\s|:]" + } + ] + }, + "keywords-berry": { + "patterns": [ + { + "name": "keyword", + "match": "\\b(version|cacheKey|resolution|dependencies|peerDependencies|peerDependenciesMeta|bin|checksum|languageName|linkType)\\b:" } ] }, @@ -57,7 +66,7 @@ "match": "\"(?:\\*|[^\"a-zA-Z]*\\d[^\"a-zA-Z]*)\"" }, { - "begin": "(version)\\s+", + "begin": "(version):?\\s+", "beginCaptures": { "1": { "name": "keyword" @@ -67,7 +76,7 @@ "patterns": [ { "name": "entity.name.function", - "match": "\"?[^\"]+\"?" + "match": "\"?[^\"\\n]+\"?" } ] }