@@ -127,7 +127,7 @@ let completionForConstructors =
127
127
);
128
128
};
129
129
130
- let completionForAttributes =
130
+ let completionForFields =
131
131
(
132
132
exportedTypes,
133
133
stamps: Hashtbl . t (int , SharedTypes . declared (SharedTypes . Type . t )),
@@ -137,11 +137,11 @@ let completionForAttributes =
137
137
(_name, stamp, results) => {
138
138
let t = Hashtbl . find(stamps, stamp);
139
139
switch (t. item. kind) {
140
- | Record (attributes ) =>
140
+ | Record (fields ) =>
141
141
(
142
- attributes
143
- |> List . filter(c => Utils . startsWith(c . aname . txt, prefix))
144
- |> List . map(c => (c , t))
142
+ fields
143
+ |> List . filter(f => Utils . startsWith(f . fname . txt, prefix))
144
+ |> List . map(f => (f , t))
145
145
)
146
146
@ results
147
147
| _ => results
@@ -235,15 +235,15 @@ type k =
235
235
| Value (Types . type_expr )
236
236
| Type (Type . t )
237
237
| Constructor (constructor , declared (Type . t ))
238
- | Attribute ( attribute , declared (Type . t ))
238
+ | Field ( field , declared (Type . t ))
239
239
| FileModule (string );
240
240
241
241
let kindToInt = k =>
242
242
switch (k) {
243
243
| Module (_ ) => 9
244
244
| FileModule (_ ) => 9
245
245
| Constructor (_ , _ ) => 4
246
- | Attribute (_ , _ ) => 5
246
+ | Field (_ , _ ) => 5
247
247
| Type (_ ) => 22
248
248
| Value (_ ) => 12
249
249
};
@@ -254,7 +254,7 @@ let detail = (name, contents) =>
254
254
| Value (typ ) => typ |> Shared . typeToString
255
255
| Module (_ ) => "module"
256
256
| FileModule (_ ) => "file module"
257
- | Attribute ({typ}, t ) =>
257
+ | Field ({typ}, t ) =>
258
258
name
259
259
++ ": "
260
260
++ (typ |> Shared . typeToString)
@@ -300,13 +300,9 @@ let localValueCompletions = (~pos, ~env: Query.queryEnv, suffix) => {
300
300
Type (t)
301
301
)
302
302
@ (
303
- completionForAttributes(
304
- env. exported. types,
305
- env. file. stamps. types,
306
- suffix,
307
- )
308
- |> List . map(((c, t)) =>
309
- {... emptyDeclared(c.aname.txt), item: Attribute (c, t)}
303
+ completionForFields(env. exported. types, env. file. stamps. types, suffix)
304
+ |> List . map(((f, t)) =>
305
+ {... emptyDeclared(f.fname.txt), item: Field (f, t)}
310
306
)
311
307
);
312
308
} else {
@@ -364,13 +360,9 @@ let valueCompletions = (~env: Query.queryEnv, suffix) => {
364
360
Type (t)
365
361
)
366
362
@ (
367
- completionForAttributes(
368
- env. exported. types,
369
- env. file. stamps. types,
370
- suffix,
371
- )
372
- |> List . map(((c, t)) =>
373
- {... emptyDeclared(c.aname.txt), item: Attribute (c, t)}
363
+ completionForFields(env. exported. types, env. file. stamps. types, suffix)
364
+ |> List . map(((f, t)) =>
365
+ {... emptyDeclared(f.fname.txt), item: Field (f, t)}
374
366
)
375
367
);
376
368
} else {
@@ -405,13 +397,9 @@ let attributeCompletions = (~env: Query.queryEnv, ~suffix) => {
405
397
)
406
398
/* completionForExporteds(env.exported.types, env.file.stamps.types, suffix, t => Type(t)) @ */
407
399
@ (
408
- completionForAttributes(
409
- env. exported. types,
410
- env. file. stamps. types,
411
- suffix,
412
- )
413
- |> List . map(((c, t)) =>
414
- {... emptyDeclared(c.aname.txt), item: Attribute (c, t)}
400
+ completionForFields(env. exported. types, env. file. stamps. types, suffix)
401
+ |> List . map(((f, t)) =>
402
+ {... emptyDeclared(f.fname.txt), item: Field (f, t)}
415
403
)
416
404
);
417
405
} else {
@@ -537,9 +525,9 @@ let getItems =
537
525
(current , name ) => {
538
526
let%opt (env, typ) = current;
539
527
switch (typ.item.SharedTypes.Type.kind) {
540
- | Record(attributes ) =>
528
+ | Record(fields ) =>
541
529
let%opt attr =
542
- attributes |> List.find_opt(a => a.aname .txt == name);
530
+ fields |> List.find_opt(f => f.fname .txt == name);
543
531
Log.log("Found attr " ++ name);
544
532
let%opt path = attr.typ |> Shared.digConstructor;
545
533
Hover.digConstructor(~env, ~getModule, path);
@@ -549,17 +537,14 @@ let getItems =
549
537
Some ((env, typ)),
550
538
);
551
539
switch (typ. item. kind) {
552
- | Record (attributes ) =>
540
+ | Record (fields ) =>
553
541
Some (
554
- attributes
555
- |> Utils . filterMap(a =>
556
- if (Utils . startsWith(a . aname . txt, suffix)) {
542
+ fields
543
+ |> Utils . filterMap(f =>
544
+ if (Utils . startsWith(f . fname . txt, suffix)) {
557
545
Some ((
558
546
env. file. uri,
559
- {
560
- ... emptyDeclared(a.aname.txt),
561
- item: Attribute (a, typ),
562
- },
547
+ {... emptyDeclared(f.fname.txt), item: Field (f, typ)},
563
548
));
564
549
} else {
565
550
None ;
0 commit comments