Skip to content

Commit c95ae57

Browse files
committed
Fix bug
1 parent 8c04031 commit c95ae57

File tree

2 files changed

+9
-19
lines changed

2 files changed

+9
-19
lines changed

src/analysis/locate.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ module Utils = struct
444444
List.dedup_adjacent files ~cmp:String.compare
445445

446446
let find_file_with_path ~config ?(with_fallback = false) file path =
447-
if File.name file = Misc.unitname Mconfig.(config.query.filename) then
447+
if File.name file = Mconfig.unitname config then
448448
Some Mconfig.(config.query.filename)
449449
else
450450
let attempt_search src_suffix_pair =

tests/test-dirs/locate/wrapping-prefix.t/run.t

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,13 @@ Compile a library named "foo"
77
Jump to the definition of "Foo.hello".
88
$ $MERLIN single locate -position 1:17 -filename bar/foo.ml < bar/foo.ml
99
{
10-
"class": "exception",
11-
"value": "File \"src/analysis/locate.ml\", line 338, characters 44-50: Assertion failed
12-
Raised at Merlin_analysis__Locate.Artifact.read in file \"src/analysis/locate.ml\", line 338, characters 44-56
13-
Called from Merlin_analysis__Locate.load_cmt in file \"src/analysis/locate.ml\", line 525, characters 19-37
14-
Called from Merlin_analysis__Locate.find_loc_of_uid in file \"src/analysis/locate.ml\", line 797, characters 10-36
15-
Called from Merlin_analysis__Locate.from_path in file \"src/analysis/locate.ml\", line 914, characters 4-20
16-
Called from Query_commands.dispatch in file \"src/frontend/query_commands.ml\", lines 648-649, characters 10-34
17-
Called from Merlin_commands__New_commands.run in file \"src/commands/new_commands.ml\", line 98, characters 15-53
18-
Called from Merlin_utils__Std.let_ref in file \"src/utils/std.ml\", line 735, characters 8-12
19-
Re-raised at Merlin_utils__Std.let_ref in file \"src/utils/std.ml\", line 741, characters 4-13
20-
Called from Merlin_utils__Misc.try_finally in file \"src/utils/misc.ml\", line 46, characters 8-15
21-
Re-raised at Merlin_utils__Misc.try_finally in file \"src/utils/misc.ml\", line 63, characters 10-24
22-
Called from Stdlib__Fun.protect in file \"fun.ml\", line 34, characters 8-15
23-
Re-raised at Stdlib__Fun.protect in file \"fun.ml\", line 39, characters 6-52
24-
Called from Merlin_kernel__Mocaml.with_state in file \"src/kernel/mocaml.ml\", line 18, characters 8-38
25-
Re-raised at Merlin_kernel__Mocaml.with_state in file \"src/kernel/mocaml.ml\", line 24, characters 4-15
26-
Called from Dune__exe__New_merlin.run.(fun) in file \"src/frontend/ocamlmerlin/new/new_merlin.ml\", lines 118-119, characters 16-52
27-
",
10+
"class": "return",
11+
"value": {
12+
"file": "$TESTCASE_ROOT/foo/foo.ml",
13+
"pos": {
14+
"line": 1,
15+
"col": 4
16+
}
17+
},
2818
"notifications": []
2919
}

0 commit comments

Comments
 (0)