Skip to content

Commit fe72fab

Browse files
tmattio3Rafal
andauthored
Refactor comment parsing to use odoc-parser and cmarkit (#1088)
* Refactor comment parsing to use odoc-parser and cmarkit Omd 2.X doesn't support printing markdown, so OCaml LSP is blocked to Omd 1.X. This creates conflicts with codebases that have migrated to Omd 2.X (e.g. in ocamlorg). To avoid conflicts for users of Omd 2.X, we migrate to cmarkit, which has a smaller dependency profile and supports printing to markdown. Co-authored-by: Rafał Gwoździński <[email protected]>
1 parent 9648a05 commit fe72fab

File tree

10 files changed

+377
-184
lines changed

10 files changed

+377
-184
lines changed

CHANGES.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
## Fixes
44

5+
- Refactor comment parsing to use `odoc-parser` and `cmarkit` instead of
6+
`octavius` and `omd` (#1088)
7+
8+
This allows users who migrated to omd 2.X to install ocaml-lsp-server in the
9+
same opam switch.
10+
11+
We also slightly improved markdown generation support and fixed a couple in
12+
the generation of inline heading and module types.
13+
514
- Allow opening documents that were already open. This is a workaround for
615
neovim's lsp client (#1067)
716

dune-project

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ possible and does not make any assumptions about IO.
5656
ordering
5757
dune-build-info
5858
spawn
59+
(cmarkit (>= 0.2.0))
60+
(odoc-parser (>= 2.0.0))
5961
(ppx_expect (and (>= v0.15.0) :with-test))
6062
(ocamlformat (and :with-test (= 0.24.1)))
6163
(ocamlc-loc (and (>= 3.5.0) (< 3.7.0)))
62-
(omd (and (>= 1.3.2) (< 2.0.0~alpha1)))
63-
(octavius (>= 1.2.2))
6464
(uutf (>= 1.0.2))
6565
(pp (>= 1.1.2))
6666
(csexp (>= 1.5))

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@
7676
duneVersion = "3";
7777
buildInputs = with pkgs.ocamlPackages; [
7878
ocamlc-loc
79-
omd
80-
octavius
79+
odoc-parser
80+
cmarkit
8181
dune-build-info
8282
re
8383
dune-rpc

ocaml-lsp-server.opam

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ depends: [
3232
"ordering"
3333
"dune-build-info"
3434
"spawn"
35+
"cmarkit" {>= "0.2.0"}
36+
"odoc-parser" {>= "2.0.0"}
3537
"ppx_expect" {>= "v0.15.0" & with-test}
3638
"ocamlformat" {with-test & = "0.24.1"}
3739
"ocamlc-loc" {>= "3.5.0" & < "3.7.0"}
38-
"omd" {>= "1.3.2" & < "2.0.0~alpha1"}
39-
"octavius" {>= "1.2.2"}
4040
"uutf" {>= "1.0.2"}
4141
"pp" {>= "1.1.2"}
4242
"csexp" {>= "1.5"}

0 commit comments

Comments
 (0)