Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit ccedef9
Author: Ulysse Gérard <thevoodoos@gmail.com>
Date:   Wed Jan 3 17:42:08 2024 +0100

    fmt

commit 1c3ebfd
Author: Ulysse Gérard <thevoodoos@gmail.com>
Date:   Wed Jan 3 17:41:52 2024 +0100

    rename: support project-wide but unsafe renaming

commit 7105c12
Author: Ulysse Gérard <thevoodoos@gmail.com>
Date:   Thu Nov 30 16:22:28 2023 +0100

    wip: make rename project wide

commit ba1d99a
Author: Ulysse Gérard <thevoodoos@gmail.com>
Date:   Thu Nov 30 14:49:28 2023 +0100

    Notify the user when the index is out of date

commit ef50a83
Author: Ulysse Gérard <thevoodoos@gmail.com>
Date:   Wed Nov 29 19:00:28 2023 +0100

    wip: get desync info from merlin

commit 5265d22
Author: Ulysse Gérard <thevoodoos@gmail.com>
Date:   Wed Nov 22 11:12:48 2023 +0100

    Handle new `unit_name` config directive

commit 2367339
Author: Ulysse Gérard <thevoodoos@gmail.com>
Date:   Thu Oct 26 15:50:49 2023 +0200

    Fix merlin config merging

commit 55ab533
Author: Ulysse Gérard <thevoodoos@gmail.com>
Date:   Wed Oct 25 16:33:38 2023 +0200

    config: accept index_file directive

commit e353220
Author: Ulysse Gérard <thevoodoos@gmail.com>
Date:   Fri Sep 29 14:23:32 2023 +0200

    Apply compiler libs changes

commit 69fea3a
Author: Ulysse Gérard <thevoodoos@gmail.com>
Date:   Tue Jun 13 17:42:00 2023 +0200

    Support project wide occurrences

commit d3d8de5
Author: Ulysse <5031221+voodoos@users.noreply.github.com>
Date:   Mon Dec 18 16:34:42 2023 +0100

    Prepare release 1.17.0 (ocaml#1219)

    * chore: restore lost version number in changes
         (erased in c8c1096)

    * chore: bump version number in changes before release

commit f9de892
Author: Ulugbek Abdullaev <ulugbekna@gmail.com>
Date:   Mon Dec 11 19:51:35 2023 +0100

    Completion for `in` keyword (ocaml#1217)

    feat(auto-completion): auto-complete `in` (in a hacky way) in .ml files

commit 9dc8de2
Author: Jules Aguillon <jules@j3s.fr>
Date:   Mon Nov 27 04:29:17 2023 +0100

    Upgrade OCamlformat to 0.26.1 (ocaml#1177)

commit 2ffaea0
Author: Rudi Grinberg <me@rgrinberg.com>
Date:   Sun Nov 26 20:29:02 2023 -0600

    chore: move dune-release to own shell (ocaml#1215)

    Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

commit 17eec24
Author: Rudi Grinberg <me@rgrinberg.com>
Date:   Sun Nov 26 20:07:08 2023 -0600

    chore: update flakes (ocaml#1214)

    Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

commit 73bf594
Author: Rudi Grinberg <me@rgrinberg.com>
Date:   Sun Nov 26 19:51:42 2023 -0600

    Completion edge cases (ocaml#1212)

    * Tests passing

    * Added support for whitespace in completion
    The solution here is to change all whitespace to spaces for ease of regex matching(all whitespace is equivelent semantically) and then remove all spaces from the prefix that's passed to merlin.

    Co-authored-by: faldor20 <eli.jambu@gmail.com>
    Co-authored-by: faldor20 <eli.jambu@yahoo.com>

commit 3b3b9bc
Author: Rudi Grinberg <me@rgrinberg.com>
Date:   Sun Nov 26 18:58:33 2023 -0600

    fix: hack to workaround dune bug (ocaml#1213)

    Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

commit c6eafd8
Author: panglesd <peada@free.fr>
Date:   Sun Oct 22 09:32:24 2023 +0200

    Compatibility with odoc-parser.2.3.0 (ocaml#1184)

    * compatibility with odoc-parser.2.3.0

    Signed-off-by: Paul-Elliot <peada@free.fr>

commit 6f78852
Author: Rudi Grinberg <me@rgrinberg.com>
Date:   Tue Oct 17 23:36:08 2023 -0600

    fix(test): correctly qualify pp dep (ocaml#1203)

    Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

commit 6bda990
Author: Bao Zhiyuan <71200607+bzy-debug@users.noreply.github.com>
Date:   Wed Oct 18 13:35:39 2023 +0800

    Fix uri to_string (ocaml#1197)

    The current implementation is not the same as uri.ts

    see microsoft/vscode-uri@96acdc0/src/uri.ts#L601

    the ts code just checks if authority is empty, while ocaml code checks
    if authority is "file"

    Co-authored-by: Bao Zhiyuan <baozhiyuan@idea.edu.cn>

commit e0c4df3
Author: Rudi Grinberg <me@rgrinberg.com>
Date:   Mon Oct 16 22:36:44 2023 -0600

    fix: odoc-parser constraints (ocaml#1204)

    we aren't compatible with 2.3.0

    Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

commit eca77cf
Author: Rudi Grinberg <me@rgrinberg.com>
Date:   Mon Oct 16 14:58:31 2023 -0600

    chore: more CHANGES formatting (ocaml#1202)

    Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

commit 208683e
Author: Rudi Grinberg <me@rgrinberg.com>
Date:   Mon Oct 16 12:25:13 2023 -0600

    chore: better formatting in CHANGES (ocaml#1201)

    Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

commit ce2e46b
Author: Rudi Grinberg <me@rgrinberg.com>
Date:   Mon Oct 16 11:21:19 2023 -0600

    chore: update flakes (ocaml#1195)

    Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

commit 841fe5c
Author: Rudi Grinberg <me@rgrinberg.com>
Date:   Mon Oct 16 11:16:05 2023 -0600

    refactor: fix against newer versions of dune (ocaml#1200)

    removes the incomplete pattern match warning on the progress

    Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

commit 672ca1b
Author: Ulysse <5031221+voodoos@users.noreply.github.com>
Date:   Wed Oct 4 00:14:05 2023 +0200

    Only return first result for type_enclosing. (ocaml#1196)

    in `type-annotate` code action.
  • Loading branch information
voodoos committed Jan 29, 2024
1 parent 8776f0c commit 1e63328
Show file tree
Hide file tree
Showing 73 changed files with 5,371 additions and 1,028 deletions.
4 changes: 4 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
# add ocamlformat config `wrap-fun-args=false`

75504946eaa6f817550b649df508d61dde12bbda
# Upgrade to OCamlformat 0.26.0
ab49baa5873e7f0b9181dbed3ad89681f1e4bcee
# Upgrade to OCamlformat 0.26.1
1a6419bac3ce012deb9c6891e6b25e2486c33388
2 changes: 1 addition & 1 deletion .ocamlformat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=0.24.1
version=0.26.1
profile=conventional
ocaml-version=4.14.0
break-separators=before
Expand Down
22 changes: 19 additions & 3 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
# Unreleased
# 1.17.0

## Fixes

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

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

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

- Disable highlighting unit as an enum member to fix comment highlighting bug. (#1185)
- Improve type-on-hover efficiency by only formatting the type of the first
enclosing. (#1191)

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

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

- Fix parsing of completion prefixes (#1181)

## Features

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

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

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

- Offer auto-completion for the keyword `in` (#1217)

# 1.16.2

## Fixes
Expand Down Expand Up @@ -93,6 +107,8 @@
[#941](https://github.com/ocaml/ocaml-lsp/issues/941),
[#1003](https://github.com/ocaml/ocaml-lsp/issues/1003))

# 1.15.0

## Features

- Enable [semantic highlighting](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_semanticTokens)
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ install: ## Install the packages on the system
lock: ## Generate the lock files
opam lock -y .

.PHONY: bench
bench: ##
dune exec ocaml-lsp-server/bench/ocaml_lsp_bench.exe --profile bench


.PHONY: test-ocaml
test-ocaml: ## Run the unit tests
dune build @lsp/test/runtest @lsp-fiber/runtest @jsonrpc-fiber/runtest @ocaml-lsp-server/runtest
Expand Down
3 changes: 2 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ possible and does not make any assumptions about IO.
ordering
dune-build-info
spawn
(odoc-parser (>= 2.0.0))
astring
camlp-streams
(ppx_expect (and (>= v0.15.0) :with-test))
(ocamlformat (and :with-test (= 0.24.1)))
(ocamlc-loc (>= 3.7.0))
Expand Down
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
ppx_yojson_conv_lib
uutf
lsp
odoc-parser
astring
camlp-streams
merlin-lib
];
doCheck = false;
Expand All @@ -110,7 +111,8 @@
duneVersion = "3";
buildInputs = with pkgs.ocamlPackages; [
ocamlc-loc
odoc-parser
astring
camlp-streams
dune-build-info
re
dune-rpc
Expand Down Expand Up @@ -150,9 +152,8 @@
buildInputs = (with pkgs;
[
# dev tools
ocamlformat_0_24_1
ocamlformat_0_26_1
yarn
dune-release

ocamlPackages.ppx_expect
ocamlPackages.utop
Expand All @@ -161,6 +162,10 @@
]);
inputsFrom = [ fast.ocaml-lsp fast.jsonrpc fast.lsp ];
};

release = pkgs.mkShell {
buildInputs = [ pkgs.dune-release ];
};
};
});
}
15 changes: 8 additions & 7 deletions lsp-fiber/src/rpc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,14 @@ end

module Table = Stdlib.Hashtbl.Make (Jsonrpc.Id)

module Make (Initialize : sig
type t
end)
(Out_request : Request_intf)
(Out_notification : Notification_intf)
(In_request : Request_intf)
(In_notification : Notification_intf) =
module Make
(Initialize : sig
type t
end)
(Out_request : Request_intf)
(Out_notification : Notification_intf)
(In_request : Request_intf)
(In_notification : Notification_intf) =
struct
type 'a out_request = 'a Out_request.t

Expand Down
25 changes: 12 additions & 13 deletions lsp/bin/metamodel/metamodel.mli
Original file line number Diff line number Diff line change
Expand Up @@ -137,25 +137,24 @@ module Path : sig
| Property of property * t
end

class map :
object
method literal : Path.t -> literalType -> literalType
class map : object
method literal : Path.t -> literalType -> literalType

method property : Path.t -> property -> property
method property : Path.t -> property -> property

method or_ : Path.t -> type_ list -> type_
method or_ : Path.t -> type_ list -> type_

method type_ : Path.t -> type_ -> type_
method type_ : Path.t -> type_ -> type_

method t : t -> t
method t : t -> t

method request : request -> request
method request : request -> request

method structure : structure -> structure
method structure : structure -> structure

method notification : notification -> notification
method notification : notification -> notification

method typeAlias : typeAlias -> typeAlias
method typeAlias : typeAlias -> typeAlias

method enumeration : enumeration -> enumeration
end
method enumeration : enumeration -> enumeration
end
49 changes: 24 additions & 25 deletions lsp/bin/ocaml/ml.mli
Original file line number Diff line number Diff line change
Expand Up @@ -144,49 +144,48 @@ module Type : sig
['env] is a custom value threaded through the path. Parent nodes can use
this to give child nodes context *)
class virtual ['env, 'm] mapreduce :
object ('self)
method virtual empty : 'm
class virtual ['env, 'm] mapreduce : object ('self)
method virtual empty : 'm

method virtual plus : 'm -> 'm -> 'm
method virtual plus : 'm -> 'm -> 'm

(** doesn't really to be here, but putting it here avoids passing [empty]
and [plus] to a general purpose [fold_left_map]*)
method private fold_left_map :
'a. f:('a -> 'a * 'm) -> 'a list -> 'a list * 'm
(** doesn't really to be here, but putting it here avoids passing [empty]
and [plus] to a general purpose [fold_left_map]*)
method private fold_left_map :
'a. f:('a -> 'a * 'm) -> 'a list -> 'a list * 'm

method alias : 'env -> t -> decl * 'm
method alias : 'env -> t -> decl * 'm

method app : 'env -> t -> t list -> t * 'm
method app : 'env -> t -> t list -> t * 'm

method assoc : 'env -> t -> t -> t * 'm
method assoc : 'env -> t -> t -> t * 'm

method constr : 'env -> constr -> constr * 'm
method constr : 'env -> constr -> constr * 'm

method field : 'env -> field -> field * 'm
method field : 'env -> field -> field * 'm

method list : 'env -> t -> t * 'm
method list : 'env -> t -> t * 'm

method path : 'env -> Path.t -> t * 'm
method path : 'env -> Path.t -> t * 'm

method optional : 'env -> t -> t * 'm
method optional : 'env -> t -> t * 'm

method poly_variant : 'env -> constr list -> t * 'm
method poly_variant : 'env -> constr list -> t * 'm

method prim : 'env -> prim -> t * 'm
method prim : 'env -> prim -> t * 'm

method record : 'env -> field list -> decl * 'm
method record : 'env -> field list -> decl * 'm

method t : 'env -> t -> t * 'm
method t : 'env -> t -> t * 'm

method decl : 'env -> decl -> decl * 'm
method decl : 'env -> decl -> decl * 'm

method tuple : 'env -> t list -> t * 'm
method tuple : 'env -> t list -> t * 'm

method var : 'env -> string -> t * 'm
method var : 'env -> string -> t * 'm

method variant : 'env -> constr list -> decl * 'm
end
method variant : 'env -> constr list -> decl * 'm
end
end

module Expr : sig
Expand Down
30 changes: 14 additions & 16 deletions lsp/bin/typescript/ts_types.ml
Original file line number Diff line number Diff line change
Expand Up @@ -79,31 +79,29 @@ module type S = sig

val dyn_of_field : field -> Dyn.t

class map :
object
method typ : typ -> typ
class map : object
method typ : typ -> typ

method sum : typ list -> typ
method sum : typ list -> typ

method interface : interface -> interface
method interface : interface -> interface

method enum_anon : Enum.t -> Enum.t
method enum_anon : Enum.t -> Enum.t

method field : field -> field
method field : field -> field

method t : t -> t
end
method t : t -> t
end

class ['a] fold :
object
method field : field -> init:'a -> 'a
class ['a] fold : object
method field : field -> init:'a -> 'a

method ident : ident -> init:'a -> 'a
method ident : ident -> init:'a -> 'a

method t : t -> init:'a -> 'a
method t : t -> init:'a -> 'a

method typ : typ -> init:'a -> 'a
end
method typ : typ -> init:'a -> 'a
end
end

module Make (Ident : sig
Expand Down
30 changes: 14 additions & 16 deletions lsp/bin/typescript/ts_types.mli
Original file line number Diff line number Diff line change
Expand Up @@ -62,31 +62,29 @@ module type S = sig

val dyn_of_field : field -> Dyn.t

class map :
object
method enum_anon : Enum.t -> Enum.t
class map : object
method enum_anon : Enum.t -> Enum.t

method field : field -> field
method field : field -> field

method interface : interface -> interface
method interface : interface -> interface

method sum : typ list -> typ
method sum : typ list -> typ

method t : t -> t
method t : t -> t

method typ : typ -> typ
end
method typ : typ -> typ
end

class ['a] fold :
object
method field : field -> init:'a -> 'a
class ['a] fold : object
method field : field -> init:'a -> 'a

method ident : ident -> init:'a -> 'a
method ident : ident -> init:'a -> 'a

method t : t -> init:'a -> 'a
method t : t -> init:'a -> 'a

method typ : typ -> init:'a -> 'a
end
method typ : typ -> init:'a -> 'a
end
end

module Unresolved : sig
Expand Down
5 changes: 3 additions & 2 deletions lsp/src/diff.ml
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@ let edit ~from:orig ~to_:formatted : TextEdit.t list =
text_edit
~line
(if prev_deleted_lines > 0 then
Replace { deleted = prev_deleted_lines; added = added_lines }
else Insert added_lines)
Replace
{ deleted = prev_deleted_lines; added = added_lines }
else Insert added_lines)
in
(line + prev_deleted_lines, 0, edit :: edits_rev)
| Equal { lines } ->
Expand Down
Loading

0 comments on commit 1e63328

Please sign in to comment.