Skip to content

Releases: ocaml/ocaml-lsp

1.8.0

25 Aug 21:17
Compare
Choose a tag to compare

CHANGES:

Features

  • Add a new code action Add missing rec keyword, which is available when
    adding a rec keyword can fix Unbound value ... error, e.g.,

    let fact n = if n = 0 then 1 else n * fact (n - 1)
                                       (* ^^^^ Unbound value fact *)

    Adding rec to the definition of fact will fix the problem. The new code
    action offers adding rec.

  • Use ocamlformat to properly format type snippets. This feature requires the
    ocamlformat-rpc opam package to be installed. (#386)

  • Add completion support for polymorphic variants, when it is possible to pin
    down the precise type. Examples (<|> stands for the cursor) when completion
    will work (#473)

    Function application:

    let foo (a: [`Alpha | `Beta]) = ()
    
    foo `A<|>
    

    Type explicitly shown:

    let a : [`Alpha | `Beta] = `B<|>
    

    Note: this is actually a bug fix, since we were ignoring the backtick when
    constructing the prefix for completion.

  • Parse merlin errors (best effort) into a more structured form. This allows
    reporting all locations as "related information" (#475)

  • Add support for Merlin Construct command as completion suggestions, i.e.,
    show complex expressions that could complete the typed hole. (#472)

  • Add a code action Construct an expression that is shown when the cursor is
    at the end of the typed hole, i.e., _|, where | is the cursor. The code
    action simply triggers the client (currently only VS Code is supported) to
    show completion suggestions. (#472)

  • Change the formatting-on-save error notification to a warning notification
    (#472)

  • Code action to qualify ("put module name in identifiers") and unqualify
    ("remove module name from identifiers") module names in identifiers (#399)

    Starting from:

    open Unix
    
    let times = Unix.times ()
    let f x = x.Unix.tms_stime, x.Unix.tms_utime

    Calling "remove module name from identifiers" with the cursor on the open
    statement will produce:

    open Unix
    
    let times = times ()
    let f x = x.tms_stime, x.tms_utime

    Calling "put module name in identifiers" will restore:

    open Unix
    
    let times = Unix.times ()
    let f x = x.Unix.tms_stime, x.Unix.tms_utime

Fixes

  • Do not show "random" documentation on hover

  • Correctly rename a variable used as a named/optional argument (#478)

  • When reporting an error at the beginning of the file, use the first line not
    the second (#489)

1.7.0

29 Jun 06:00
Compare
Choose a tag to compare

CHANGES:

Features

  • Add sub-errors as "related" information in diagnostics (#457)

  • Add support for navigating to a symbol inside a workspace (#398)

1.6.1

18 May 17:46
Compare
Choose a tag to compare

CHANGES:

Fixes

  • Switch verbosity from 1 to 0. This is the same default that merlin uses.
    The old value for verbosity (#433)

  • Get fresh diagnostics (warning and error messages) on a file save (#438)

    Note: If you want the fresh diagnostics to take into account changes in other
    files, you likely need to rebuild your project. An easy way to get automatic
    rebuilds is to run dune in a watching mode, e.g.,[dune build --watch].

1.6.0

01 May 01:45
Compare
Choose a tag to compare

CHANGES:

Features

  • Code action to annotate a value with its type (#397)

Fixes

  • Fix interface/implementation switching on Windows (#427)

  • Correctly parse project paths with spaces and other special characters that
    must be escaped.

  • Print types with -short-paths even if the project wasn't built yet

1.5.0

18 Mar 22:06
Compare
Choose a tag to compare

CHANGES:

  • Support 4.12 and drop support for all earlier versions

  • Update to the latest version of merlin

Distribution 1.4.1

17 Mar 05:25
Compare
Choose a tag to compare

CHANGES:

Fixes

  • Backport fixes from merlin (#382, #383)

  • Encode request & notification params in a list. This is required by the
    spec. (#351)

Distribution 1.4.0

18 Dec 01:58
Compare
Choose a tag to compare

CHANGES:

Features

  • Support cancellation notifications when possible. (#323)

  • Implement signature help request for functions (#324)

  • Server LSP requests & notifications concurrently. Requests that require merlin
    are still serialized. (#330)

Distribution 1.3.0

24 Nov 16:12
47d0169
Compare
Choose a tag to compare

CHANGES:

Features

  • Code action to insert inferred module interface (#308)

  • Filter keywords by context (#307)

Distribution 1.2.0

16 Nov 20:42
Compare
Choose a tag to compare

CHANGES:

Features

  • Add keyword completion

  • Add go to declaration functionality to jump to a value's specification in a
    .mli file (#294)

Fixes

  • #245: correctly use mutexes on OpenBSD (#264)

  • #268: Do not use vendored libraries when building the lsp package (#260)

  • #271: Clear diagnostics when files are closed

  • Disable non-prefix completion. There's no reliably way to trigger it and it
    can be slow.

Distribution 1.1.0

14 Oct 23:24
Compare
Choose a tag to compare

CHANGES:

Features

  • Implement a command to switch between module interfaces and implementations
    (#254)

Fixes

  • Do not crash on invalid positions (#248)

  • add missing record fields to list of completions (#253)

  • do not offer destruct as a code action in interface files (#255)