Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not invoke dune at all if --fallback-read-dot-merlin flag is on #1173

Merged
merged 2 commits into from
Aug 22, 2023
Merged

Do not invoke dune at all if --fallback-read-dot-merlin flag is on #1173

merged 2 commits into from
Aug 22, 2023

Conversation

SamChou19815
Copy link
Contributor

Fix #859.

For background, internally at Meta we use buck2 to build ocaml code, and we have a script to automatically generate a .merlin file based on the build artifacts. I'm not asking for a buck2 integration here. I'm simply fix the issue that blocks us from switching away from the long dead ocaml-language-server.

I find that the flag doesn't work if the environment does not have dune installed, because it will unconditionally run some dune command before even checking the --fallback-read-dot-merlin flag. This PR moves the check earlier, so that when the flag is on, it fully bypasses the dune workflow.

@gridbugs
Copy link
Contributor

Thanks for the fix! I'm not an ocaml-lsp maintainer but I came across this fix because I was just bitten by #859 myself and this patch solves my problem.

@coveralls
Copy link

coveralls commented Aug 22, 2023

Pull Request Test Coverage Report for Build 3944

  • 14 of 17 (82.35%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.003%) to 18.381%

Changes Missing Coverage Covered Lines Changed/Added Lines %
ocaml-lsp-server/src/merlin_config.ml 14 17 82.35%
Files with Coverage Reduction New Missed Lines %
ocaml-lsp-server/src/import.ml 1 35.9%
Totals Coverage Status
Change from base Build 3939: 0.003%
Covered Lines: 4338
Relevant Lines: 23600

💛 - Coveralls

@rgrinberg rgrinberg merged commit 34982f9 into ocaml:master Aug 22, 2023
9 checks passed
@rgrinberg rgrinberg added this to the 1.17.0 milestone Aug 22, 2023
@SamChou19815 SamChou19815 deleted the remove-dune-dep-for-fallback-read-dot-merlin branch August 22, 2023 20:11
voodoos added a commit to voodoos/opam-repository that referenced this pull request Dec 18, 2023
CHANGES:

## Fixes

- Fix missing super & subscripts in markdown documentation. (ocaml/ocaml-lsp#1170)

- Do not invoke dune at all if `--fallback-read-dot-merlin` flag is on. (ocaml/ocaml-lsp#1173)

- Fix semantic highlighting of infix operators that contain '.'. (ocaml/ocaml-lsp#1186)

- Disable highlighting unit as an enum member to fix comment highlighting bug. (ocaml/ocaml-lsp#1185)

- Improve type-on-hover and type-annotate efficiency by only formatting the type
  of the first enclosing. (ocaml/ocaml-lsp#1191, ocaml/ocaml-lsp#1196)

- Fix the encoding of URI's to match how vscode does it (ocaml/ocaml-lsp#1197)

- Fix parsing of completion prefixes (ocaml/ocaml-lsp#1181)

## Features

- Compatibility with Odoc 2.3.0, with support for the introduced syntax: tables,
  and "codeblock output" (ocaml/ocaml-lsp#1184)

- Display text of references in doc strings (ocaml/ocaml-lsp#1166)

- Add mark/remove unused actions for open, types, for loop indexes, modules,
  match cases, rec, and constructors (ocaml/ocaml-lsp#1141)

- Offer auto-completion for the keyword `in` (ocaml/ocaml-lsp#1217)
nberth pushed a commit to nberth/opam-repository that referenced this pull request Jun 18, 2024
CHANGES:

## Fixes

- Fix missing super & subscripts in markdown documentation. (ocaml/ocaml-lsp#1170)

- Do not invoke dune at all if `--fallback-read-dot-merlin` flag is on. (ocaml/ocaml-lsp#1173)

- Fix semantic highlighting of infix operators that contain '.'. (ocaml/ocaml-lsp#1186)

- Disable highlighting unit as an enum member to fix comment highlighting bug. (ocaml/ocaml-lsp#1185)

- Improve type-on-hover and type-annotate efficiency by only formatting the type
  of the first enclosing. (ocaml/ocaml-lsp#1191, ocaml/ocaml-lsp#1196)

- Fix the encoding of URI's to match how vscode does it (ocaml/ocaml-lsp#1197)

- Fix parsing of completion prefixes (ocaml/ocaml-lsp#1181)

## Features

- Compatibility with Odoc 2.3.0, with support for the introduced syntax: tables,
  and "codeblock output" (ocaml/ocaml-lsp#1184)

- Display text of references in doc strings (ocaml/ocaml-lsp#1166)

- Add mark/remove unused actions for open, types, for loop indexes, modules,
  match cases, rec, and constructors (ocaml/ocaml-lsp#1141)

- Offer auto-completion for the keyword `in` (ocaml/ocaml-lsp#1217)
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.

.merlin based projects still require a blank dune-project file
4 participants