Skip to content

Commit 9bb6dcd

Browse files
Add outline.scm file to enable search buffer symbols
1 parent b3930c1 commit 9bb6dcd

1 file changed

Lines changed: 76 additions & 0 deletions

File tree

languages/rescript/outline.scm

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
; Let declarations, e.g. `let foo = 42`
2+
(let_declaration
3+
["let" "export"] @context
4+
(let_binding
5+
pattern: (_) @name) @item)
6+
7+
; Recursive let declarations, e.g. `let rec fib = n => ...`
8+
(let_declaration
9+
["let" "export"] @context
10+
"rec" @context
11+
(let_binding
12+
pattern: (_) @name) @item)
13+
14+
; Type declarations, e.g. `type t = int`
15+
(type_declaration
16+
"type" @context
17+
(type_binding
18+
name: (_) @name) @item)
19+
20+
; Recursive type declarations, e.g. `type rec tree<'a> = ...`
21+
(type_declaration
22+
"type" @context
23+
"rec" @context
24+
(type_binding
25+
name: (_) @name) @item)
26+
27+
; Exported type declarations, e.g. `export type t = int`
28+
(type_declaration
29+
"export" @context
30+
"type" @context
31+
(type_binding
32+
name: (_) @name) @item)
33+
34+
; Module declarations, e.g. `module Foo = { ... }`
35+
(module_declaration
36+
"module" @context
37+
(module_binding
38+
name: (_) @name) @item)
39+
40+
; Recursive module declarations, e.g. `module rec Foo = { ... }`
41+
(module_declaration
42+
"module" @context
43+
"rec" @context
44+
(module_binding
45+
name: (_) @name) @item)
46+
47+
; Module type declarations, e.g. `module type S = { ... }`
48+
(module_declaration
49+
"module" @context
50+
"type" @context
51+
(module_binding
52+
name: (_) @name) @item)
53+
54+
; External declarations, e.g. `external log: string => unit = "console.log"`
55+
(external_declaration
56+
"external" @context
57+
(value_identifier) @name) @item
58+
59+
; Exception declarations, e.g. `exception NotFound`
60+
(exception_declaration
61+
"exception" @context
62+
(variant_identifier) @name) @item
63+
64+
; Open statements, e.g. `open Belt`
65+
(open_statement
66+
"open" @context
67+
(_) @name) @item
68+
69+
; Include statements, e.g. `include React.Component`
70+
(include_statement
71+
"include" @context
72+
(_) @name) @item
73+
74+
; Variant declarations inside type bodies, e.g. `Foo | Bar(int)`
75+
(variant_declaration
76+
(variant_identifier) @name) @item

0 commit comments

Comments
 (0)