aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/scopes_mapper.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/scopes_mapper.ts')
-rw-r--r--editors/code/src/scopes_mapper.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/editors/code/src/scopes_mapper.ts b/editors/code/src/scopes_mapper.ts
index 5c3cb8f63..4534d8a32 100644
--- a/editors/code/src/scopes_mapper.ts
+++ b/editors/code/src/scopes_mapper.ts
@@ -8,11 +8,11 @@ let mappings = new Map<string, string[]>()
8 8
9 9
10const defaultMapping = new Map<string, string[]>([ 10const defaultMapping = new Map<string, string[]>([
11 ['comment', ['comment']], 11 ['comment', ['comment', 'comment.block', 'comment.line', 'comment.block.documentation']],
12 ['string', ['string']], 12 ['string', ['string']],
13 ['keyword', ['keyword']], 13 ['keyword', ['keyword']],
14 ['keyword.control', ['keyword.control', 'keyword', 'keyword.other']], 14 ['keyword.control', ['keyword.control', 'keyword', 'keyword.other']],
15 ['keyword.unsafe', ['storage.modifier', 'keyword.other', 'keyword.control']], 15 ['keyword.unsafe', ['storage.modifier', 'keyword.other', 'keyword.control', 'keyword']],
16 ['function', ['entity.name.function']], 16 ['function', ['entity.name.function']],
17 ['parameter', ['variable.parameter']], 17 ['parameter', ['variable.parameter']],
18 ['constant', ['constant', 'variable']], 18 ['constant', ['constant', 'variable']],
@@ -23,9 +23,9 @@ const defaultMapping = new Map<string, string[]>([
23 ['literal', ['string', 'string.quoted', 'string.regexp']], 23 ['literal', ['string', 'string.quoted', 'string.regexp']],
24 ['macro', ['support.other']], 24 ['macro', ['support.other']],
25 ['variable', ['variable']], 25 ['variable', ['variable']],
26 ['variable.mut', ['variable']], 26 ['variable.mut', ['variable', 'storage.modifier']],
27 ['field', ['variable.object.property']], 27 ['field', ['variable.object.property', 'meta.field.declaration', 'meta.definition.property', 'variable.other',]],
28 ['module', ['entity.name.section']] 28 ['module', ['entity.name.section', 'entity.other']]
29] 29]
30) 30)
31function find(scope: string): string[] { 31function find(scope: string): string[] {
@@ -33,7 +33,7 @@ function find(scope: string): string[] {
33} 33}
34 34
35export function toRule(scope: string, intoRule: (scope: string) => TextMateRuleSettings | undefined): TextMateRuleSettings | undefined { 35export function toRule(scope: string, intoRule: (scope: string) => TextMateRuleSettings | undefined): TextMateRuleSettings | undefined {
36 return find(scope).map(intoRule).find(rule => rule !== null) 36 return find(scope).map(intoRule).filter(rule => rule !== undefined)[0];
37} 37}
38 38
39 39