diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 634deb8..89b59e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/checkout@v4 - uses: ocaml/setup-ocaml@v3 diff --git a/bin/httui-lsp/schema_store.ml b/bin/httui-lsp/schema_store.ml index 86870f8..0526739 100644 --- a/bin/httui-lsp/schema_store.ml +++ b/bin/httui-lsp/schema_store.ml @@ -28,6 +28,9 @@ let rec shape_of_json : Yojson.Safe.t -> Httui_lang.Shape.t = function absolute path ends in "/" + the stored relative path. The filter runs client-side: the table holds one small row per executed alias. *) let row_matches ~file_path stored = + (* document URIs yield backslash paths on Windows *) + let normalize p = String.map (fun c -> if c = '\\' then '/' else c) p in + let file_path = normalize file_path and stored = normalize stored in stored = file_path || String.ends_with ~suffix:("/" ^ stored) file_path (** [(alias, shape)] pairs inferred for the document at absolute path diff --git a/test/test_lsp.ml b/test/test_lsp.ml index fb09060..29fda29 100644 --- a/test/test_lsp.ml +++ b/test/test_lsp.ml @@ -534,6 +534,7 @@ let () = send_to c3 (req 9 "shutdown"); let _ = recv_from c3 in send_to c3 (notif "exit"); - Sys.remove db_path; + (* best effort: on Windows the server may still hold the file *) + (try Sys.remove db_path with Sys_error _ -> ()); if !failures > 0 then exit 1