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.ts17
1 files changed, 8 insertions, 9 deletions
diff --git a/editors/code/src/scopes_mapper.ts b/editors/code/src/scopes_mapper.ts
index 85c791ff5..e738fa239 100644
--- a/editors/code/src/scopes_mapper.ts
+++ b/editors/code/src/scopes_mapper.ts
@@ -10,15 +10,15 @@ const defaultMapping = new Map<string, string[]>([
10 'comment', 10 'comment',
11 'comment.block', 11 'comment.block',
12 'comment.line', 12 'comment.line',
13 'comment.block.documentation' 13 'comment.block.documentation',
14 ] 14 ],
15 ], 15 ],
16 ['string', ['string']], 16 ['string', ['string']],
17 ['keyword', ['keyword']], 17 ['keyword', ['keyword']],
18 ['keyword.control', ['keyword.control', 'keyword', 'keyword.other']], 18 ['keyword.control', ['keyword.control', 'keyword', 'keyword.other']],
19 [ 19 [
20 'keyword.unsafe', 20 'keyword.unsafe',
21 ['storage.modifier', 'keyword.other', 'keyword.control', 'keyword'] 21 ['storage.modifier', 'keyword.other', 'keyword.control', 'keyword'],
22 ], 22 ],
23 ['function', ['entity.name.function']], 23 ['function', ['entity.name.function']],
24 ['parameter', ['variable.parameter']], 24 ['parameter', ['variable.parameter']],
@@ -28,7 +28,7 @@ const defaultMapping = new Map<string, string[]>([
28 ['text', ['string', 'string.quoted', 'string.regexp']], 28 ['text', ['string', 'string.quoted', 'string.regexp']],
29 ['attribute', ['keyword']], 29 ['attribute', ['keyword']],
30 ['literal', ['string', 'string.quoted', 'string.regexp']], 30 ['literal', ['string', 'string.quoted', 'string.regexp']],
31 ['macro', ['support.other']], 31 ['macro', ['entity.name.function', 'keyword.other', 'entity.name.macro']],
32 ['variable', ['variable']], 32 ['variable', ['variable']],
33 ['variable.mut', ['variable', 'storage.modifier']], 33 ['variable.mut', ['variable', 'storage.modifier']],
34 [ 34 [
@@ -37,20 +37,19 @@ const defaultMapping = new Map<string, string[]>([
37 'variable.object.property', 37 'variable.object.property',
38 'meta.field.declaration', 38 'meta.field.declaration',
39 'meta.definition.property', 39 'meta.definition.property',
40 'variable.other' 40 'variable.other',
41 ] 41 ],
42 ], 42 ],
43 ['module', ['entity.name.section', 'entity.other']] 43 ['module', ['entity.name.section', 'entity.other']],
44]); 44]);
45 45
46// Temporary exported for debugging for now.
47export function find(scope: string): string[] { 46export function find(scope: string): string[] {
48 return mappings.get(scope) || []; 47 return mappings.get(scope) || [];
49} 48}
50 49
51export function toRule( 50export function toRule(
52 scope: string, 51 scope: string,
53 intoRule: (scope: string) => TextMateRuleSettings | undefined 52 intoRule: (scope: string) => TextMateRuleSettings | undefined,
54): TextMateRuleSettings | undefined { 53): TextMateRuleSettings | undefined {
55 return find(scope) 54 return find(scope)
56 .map(intoRule) 55 .map(intoRule)