Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ unreleased
+ ocaml-index
- Improve the granularity of index reading by segmenting the marshalization
of the involved data-structures. (#1889)
+ test suite
- Add a test case illustrating wrong open order proposed in issue #1900. (#1901)

merlin 5.4.1
============
Expand Down
2 changes: 1 addition & 1 deletion tests/test-dirs/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(cram
(applies_to no-escape type-expr environment_on_open locate-type
polarity-search)
polarity-search issue1900)
(enabled_if
(<> %{os_type} Win32)))

Expand Down
1 change: 1 addition & 0 deletions tests/test-dirs/issue1900.t/a.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let x = "test"
4 changes: 4 additions & 0 deletions tests/test-dirs/issue1900.t/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(executable
(name main)
(libraries lib)
(flags :standard -open Lib))
1 change: 1 addition & 0 deletions tests/test-dirs/issue1900.t/dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(lang dune 3.0)
Empty file.
2 changes: 2 additions & 0 deletions tests/test-dirs/issue1900.t/lib/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(library
(name lib))
1 change: 1 addition & 0 deletions tests/test-dirs/issue1900.t/main.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
prerr_endline A.x
78 changes: 78 additions & 0 deletions tests/test-dirs/issue1900.t/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
$ dune exec ./main.exe
test

FIXME: There should be no error.
$ $MERLIN single errors -filename main.ml <main.ml | jq '.value'
[
{
"start": {
"line": 1,
"col": 14
},
"end": {
"line": 1,
"col": 17
},
"type": "typer",
"sub": [],
"valid": true,
"message": "Unbound value A.x"
}
]

FIXME: Dune should communicate the -open Dune__exe flag after the others.
$ $MERLIN single dump-configuration -filename main.ml <main.ml | \
> jq '.value.merlin.flags_applied'
[
{
"workdir": "$TESTCASE_ROOT",
"workval": [
"-open",
"Dune__exe"
]
},
{
"workdir": "$TESTCASE_ROOT",
"workval": [
"-w",
"@1..3@5..28@30..39@43@46..47@49..57@61..62-40",
"-strict-sequence",
"-strict-formats",
"-short-paths",
"-keep-locs",
"-open",
"Lib",
"-g"
]
}
]

Using a .merlin with the FLG flags in the correct order works:
$ cat >.merlin <<'EOF'
> B _build/default/.main.eobjs/byte
> B _build/default/lib/.lib.objs/byte
> FLG -open Lib
> FLG -open Dune__exe
> EOF

$ $MERLIN single dump-configuration -filename main.ml <main.ml | \
> jq '.value.merlin.flags_applied'
[
{
"workdir": "$TESTCASE_ROOT",
"workval": [
"-open",
"Lib"
]
},
{
"workdir": "$TESTCASE_ROOT",
"workval": [
"-open",
"Dune__exe"
]
}
]

$ $MERLIN single errors -filename main.ml <main.ml | jq '.value'
[]
Loading