Skip to content
This repository was archived by the owner on Apr 24, 2021. It is now read-only.

Commit dd19161

Browse files
committed
Remove recordAllLocations.
1 parent c3ad99c commit dd19161

File tree

6 files changed

+11
-45
lines changed

6 files changed

+11
-45
lines changed

src/rescript-editor-support/NotificationHandlers.re

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ let watchedFileContentsMap = Hashtbl.create(100);
1414

1515
let reloadAllState = state => {
1616
Log.log("RELOADING ALL STATE");
17-
{
18-
...TopTypes.empty(),
19-
documentText: state.documentText,
20-
settings: state.settings,
21-
};
17+
{...TopTypes.empty(), documentText: state.documentText};
2218
};
2319

2420
let notificationHandlers:

src/rescript-editor-support/ProcessExtra.re

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ module F =
8787
let extra: extra;
8888
let file: file;
8989
let scopeExtent: ref(list(Location.t));
90-
let allLocations: bool;
9190
},
9291
) => {
9392
let extra = Collector.extra;
@@ -470,9 +469,6 @@ module F =
470469
addForPattern(stamp, name);
471470
| _ => ()
472471
};
473-
if (Collector.allLocations) {
474-
addLocation(pat_loc, Typed(pat_type, NotFound));
475-
};
476472
};
477473

478474
let enter_expression = expression => {
@@ -528,9 +524,6 @@ module F =
528524
}
529525
| _ => ()
530526
};
531-
if (Collector.allLocations) {
532-
addLocation(expression.exp_loc, Typed(expression.exp_type, NotFound));
533-
};
534527
};
535528

536529
let leave_expression = expression => {
@@ -613,7 +606,7 @@ let forFile = (~file) => {
613606
extra;
614607
};
615608

616-
let forItems = (~file, ~allLocations, items, parts) => {
609+
let forItems = (~file, items, parts) => {
617610
let extra = forFile(~file);
618611

619612
let extent = ProcessCmt.itemsExtent(items);
@@ -635,7 +628,6 @@ let forItems = (~file, ~allLocations, items, parts) => {
635628
let scopeExtent = ref([extent]);
636629
let extra = extra;
637630
let file = file;
638-
let allLocations = allLocations;
639631
})
640632
),
641633
);
@@ -661,7 +653,7 @@ let forItems = (~file, ~allLocations, items, parts) => {
661653
extra;
662654
};
663655

664-
let forCmt = (~file, ~allLocations, {cmt_annots}: Cmt_format.cmt_infos) =>
656+
let forCmt = (~file, {cmt_annots}: Cmt_format.cmt_infos) =>
665657
switch (cmt_annots) {
666658
| Partial_implementation(parts) =>
667659
let items =
@@ -676,12 +668,10 @@ let forCmt = (~file, ~allLocations, {cmt_annots}: Cmt_format.cmt_infos) =>
676668
}
677669
)
678670
|> List.concat;
679-
forItems(~file, ~allLocations, items, parts);
680-
| Implementation(structure) =>
681-
forItems(~file, ~allLocations, structure.str_items, [||])
671+
forItems(~file, items, parts);
672+
| Implementation(structure) => forItems(~file, structure.str_items, [||])
682673
| Partial_interface(_)
683674
| Interface(_) =>
684-
/** TODO actually process signature items */
685-
forItems(~file, ~allLocations, [], [||])
686-
| _ => forItems(~file, ~allLocations, [], [||])
675+
/** TODO actually process signature items */ forItems(~file, [], [||])
676+
| _ => forItems(~file, [], [||])
687677
};

src/rescript-editor-support/Process_406.re

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ let fileForCmt = (~moduleName, cmt, uri, processDoc) => {
55
Ok(ProcessCmt.forCmt(~moduleName, uri, processDoc, infos));
66
};
77

8-
let fullForCmt = (~moduleName, ~allLocations, cmt, uri, processDoc) => {
8+
let fullForCmt = (~moduleName, cmt, uri, processDoc) => {
99
let%try infos = Shared.tryReadCmt(cmt);
1010
let file = ProcessCmt.forCmt(~moduleName, uri, processDoc, infos);
11-
let extra = ProcessExtra.forCmt(~file, ~allLocations, infos);
11+
let extra = ProcessExtra.forCmt(~file, infos);
1212
Ok({file, extra});
1313
};
1414

src/rescript-editor-support/Process_406.rei

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,5 @@ let fileForCmt:
33
result(SharedTypes.file, string);
44

55
let fullForCmt:
6-
(
7-
~moduleName: string,
8-
~allLocations: bool,
9-
string,
10-
string,
11-
string => string
12-
) =>
6+
(~moduleName: string, string, string, string => string) =>
137
result(SharedTypes.full, string);

src/rescript-editor-support/State.re

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,7 @@ let getFullFromCmt = (~state, ~uri) => {
6666
switch (Hashtbl.find_opt(package.pathsForModule, moduleName)) {
6767
| Some(paths) =>
6868
let cmt = SharedTypes.getCmt(~interface=Utils.endsWith(uri, "i"), paths);
69-
let%try full =
70-
Process_406.fullForCmt(
71-
~moduleName,
72-
~allLocations=state.settings.recordAllLocations,
73-
cmt,
74-
uri,
75-
x =>
76-
x
77-
);
69+
let%try full = Process_406.fullForCmt(~moduleName, cmt, uri, x => x);
7870
Hashtbl.replace(
7971
package.interModuleDependencies,
8072
moduleName,

src/rescript-editor-support/TopTypes.re

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@ type package = {
1616
opens: list(string),
1717
};
1818

19-
type settings = {recordAllLocations: bool};
20-
2119
type state = {
2220
rootUri: uri,
23-
settings,
2421
documentText: Hashtbl.t(uri, (string, int, bool)),
2522
packagesByRoot: Hashtbl.t(string, package),
2623
rootForUri: Hashtbl.t(uri, string),
@@ -33,7 +30,4 @@ let empty = () => {
3330
packagesByRoot: Hashtbl.create(1),
3431
rootForUri: Hashtbl.create(30),
3532
cmtCache: Hashtbl.create(30),
36-
settings: {
37-
recordAllLocations: false,
38-
},
3933
};

0 commit comments

Comments
 (0)