Skip to content

Commit

Permalink
Merge branch 'master-origin'
Browse files Browse the repository at this point in the history
  • Loading branch information
faldor20 committed Oct 21, 2023
2 parents c4249a8 + 6f78852 commit 6aa39f3
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 14 deletions.
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@
## 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 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)

## Features

- 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)

Expand Down
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ possible and does not make any assumptions about IO.
ordering
dune-build-info
spawn
(odoc-parser (>= 2.0.0))
(odoc-parser (and (>= 2.0.0) (< 2.3.0)))
(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.

3 changes: 2 additions & 1 deletion lsp/src/uri0.ml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ let to_string { scheme; authority; path } =
Buffer.add_string buff scheme;
Buffer.add_char buff ':');

if authority = "file" || scheme = "file" then Buffer.add_string buff "//";
if (not (String.is_empty authority)) || scheme = "file" then
Buffer.add_string buff "//";

(*TODO: implement full logic:
https://github.com/microsoft/vscode-uri/blob/96acdc0be5f9d5f2640e1c1f6733bbf51ec95177/src/uri.ts#L605 *)
Expand Down
3 changes: 3 additions & 0 deletions lsp/test/uri_tests.ml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ let%expect_test "of_string -> to_string" =
; ""
; "file://LöC%2FAL/host:8080/projects/"
; "file:///pro%2Fjects/"
; "vscode://mount/test.ml"
];
[%expect
{|
Expand All @@ -230,6 +231,7 @@ let%expect_test "of_string -> to_string" =
-> file:///
file://LöC%2FAL/host:8080/projects/ -> file://l%C3%B6c%2Fal/host%3A8080/projects/
file:///pro%2Fjects/ -> file:///pro/jects/
vscode://mount/test.ml -> vscode://mount/test.ml
Windows:
file://shares/pröjects/c%23/#l12 -> file://shares/pr%C3%B6jects/c%23/
file://sh%c3%a4res/path -> file://sh%C3%A4res/path
Expand All @@ -241,6 +243,7 @@ let%expect_test "of_string -> to_string" =
-> file:///
file://LöC%2FAL/host:8080/projects/ -> file://l%C3%B6c%2Fal/host%3A8080/projects/
file:///pro%2Fjects/ -> file:///pro/jects/
vscode://mount/test.ml -> vscode://mount/test.ml
|}]

let%expect_test "of_string -> to_path" =
Expand Down
2 changes: 1 addition & 1 deletion ocaml-lsp-server.opam
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ depends: [
"ordering"
"dune-build-info"
"spawn"
"odoc-parser" {>= "2.0.0"}
"odoc-parser" {>= "2.0.0" & < "2.3.0"}
"ppx_expect" {>= "v0.15.0" & with-test}
"ocamlformat" {with-test & = "0.24.1"}
"ocamlc-loc" {>= "3.7.0"}
Expand Down
12 changes: 8 additions & 4 deletions ocaml-lsp-server/src/progress.ml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ let build_progress t (progress : Drpc.Progress.t) =
| Failed -> end_build t ~message:"Build failed"
| Interrupted -> end_build t ~message:"Build interrupted"
| Waiting -> end_build t ~message:"Waiting for changes"
| In_progress { complete; remaining } ->
| In_progress progress ->
let* token =
match token with
| Some token -> Fiber.return token
Expand All @@ -75,19 +75,23 @@ let build_progress t (progress : Drpc.Progress.t) =
build. *)
start_build t
in
let total = complete + remaining in
let total = progress.complete + progress.remaining in
(* The percentage is useless as it isn't monotinically increasing as
the spec requires, but it's the best we can do. *)
let percentage =
let fraction = float_of_int complete /. float_of_int total in
let fraction =
float_of_int progress.complete /. float_of_int total
in
int_of_float (fraction *. 100.)
in
report_progress
(ProgressParams.create
~token
~value:
(Progress.Report
(let message = sprintf "Building [%d/%d]" complete total in
(let message =
sprintf "Building [%d/%d]" progress.complete total
in
WorkDoneProgressReport.create ~percentage ~message ())))))

let should_report_build_progress = function
Expand Down
6 changes: 5 additions & 1 deletion ocaml-lsp-server/test/e2e-new/dune
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@
ppx_expect.config
ppx_expect.config_types
ppx_inline_test.config)
(preprocessor_deps for_pp.sh)
(preprocess
(per_module
((action
(run sh %{dep:for_pp.sh} %{input-file}))
(run
sh ;; we don't rely on the shebang line for windoze
%{project_root}/ocaml-lsp-server/test/e2e-new/for_pp.sh
%{input-file}))
for_pp)
((pps ppx_expect)
action_extract
Expand Down

0 comments on commit 6aa39f3

Please sign in to comment.