Skip to content

Add error messages for external configuration readers and disable quoting#1152

Merged
voodoos merged 6 commits intoocaml:masterfrom
voodoos:ocaml-merlin-errors
Sep 10, 2020
Merged

Add error messages for external configuration readers and disable quoting#1152
voodoos merged 6 commits intoocaml:masterfrom
voodoos:ocaml-merlin-errors

Conversation

@voodoos
Copy link
Copy Markdown
Collaborator

@voodoos voodoos commented Jul 8, 2020

This PR add better error reporting for the external readers.

Covered cases:

  • External reader unexpectedly not-running:

    • A problem occurred with merlin external configuration reader. Check that 'dot-merlin-reader' is installed. If the problem persists, please file an issue on Merlin's tracker.
    • A problem occurred with merlin external configuration reader. Check that 'dune' is installed and up-to-date. If the problem persists, please file an issue on Merlin's tracker.
  • Bad output from the external reader. That can happen if merlin tries to start dune ocaml-merlin with a version of dune that doesn't support this sub-command. Dune then prints it's help, which is not a valid csexp.

    • Merlin could not load its configuration from the external reader. Building your project with 'dune' might solve this issue.

This PR broke the tests: most of the tests do not have a .merlin file and the closest config file in parent directories was the dune-project file. This triggers a Project is not built message from the dune ocaml-merlin config reader.

To prevent that behaviour I added a dummy merlin file to the test-dirs directory to trick merlin in using dot-merlin-reader.

@voodoos voodoos force-pushed the ocaml-merlin-errors branch from 7b0bc3d to 8c52fe4 Compare July 8, 2020 14:20
@voodoos voodoos force-pushed the ocaml-merlin-errors branch from 1eaa536 to f09c8ef Compare July 24, 2020 10:06
@voodoos voodoos changed the title Add more-precise error messages for external configuration readers Add error messages for external configuration readers and disable quoting Aug 4, 2020
@voodoos voodoos force-pushed the ocaml-merlin-errors branch 2 times, most recently from 5912582 to c259798 Compare August 10, 2020 15:59
@trefis trefis force-pushed the ocaml-merlin-errors branch from 798ce3f to 60e2a1f Compare September 9, 2020 14:44
@voodoos voodoos force-pushed the ocaml-merlin-errors branch from 60e2a1f to 7838f78 Compare September 10, 2020 09:43
@voodoos voodoos merged commit 53a1740 into ocaml:master Sep 10, 2020
voodoos added a commit to voodoos/opam-repository that referenced this pull request Sep 16, 2020
CHANGES:

Wed Sep 16 15:00:42 CEST 2020

  + merlin binary
    - fix completion of pattern matchings with exception patterns (ocaml/merlin#1169)
    - delegate configuration reading to external programs via a simple protocol
    and create a new package `dot-merlin-reader` with a binary that reads
    `.merlin` files. (ocaml/merlin#1123, ocaml/merlin#1152)
voodoos added a commit to voodoos/merlin that referenced this pull request Nov 5, 2020
…ting (ocaml#1152)

* Add more-precise error messages

* Move rev from protocol to dot-merlin-reader

* Move un-quoting work to dot-merlin-reader

* Error if asking dune 2.6 for configuration

* Change CHANGES
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant