Skip to content

Commit

Permalink
Refactor comment parsing to use odoc-parser and cmarkit (#1088)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
tmattio and 3Rafal authored Jun 8, 2023
1 parent 9648a05 commit fe72fab
Show file tree
Hide file tree
Showing 10 changed files with 377 additions and 184 deletions.
9 changes: 9 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

## Fixes

- Refactor comment parsing to use `odoc-parser` and `cmarkit` instead of
`octavius` and `omd` (#1088)

This allows users who migrated to omd 2.X to install ocaml-lsp-server in the
same opam switch.

We also slightly improved markdown generation support and fixed a couple in
the generation of inline heading and module types.

- Allow opening documents that were already open. This is a workaround for
neovim's lsp client (#1067)

Expand Down
4 changes: 2 additions & 2 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ possible and does not make any assumptions about IO.
ordering
dune-build-info
spawn
(cmarkit (>= 0.2.0))
(odoc-parser (>= 2.0.0))
(ppx_expect (and (>= v0.15.0) :with-test))
(ocamlformat (and :with-test (= 0.24.1)))
(ocamlc-loc (and (>= 3.5.0) (< 3.7.0)))
(omd (and (>= 1.3.2) (< 2.0.0~alpha1)))
(octavius (>= 1.2.2))
(uutf (>= 1.0.2))
(pp (>= 1.1.2))
(csexp (>= 1.5))
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

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

4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@
duneVersion = "3";
buildInputs = with pkgs.ocamlPackages; [
ocamlc-loc
omd
octavius
odoc-parser
cmarkit
dune-build-info
re
dune-rpc
Expand Down
4 changes: 2 additions & 2 deletions ocaml-lsp-server.opam
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ depends: [
"ordering"
"dune-build-info"
"spawn"
"cmarkit" {>= "0.2.0"}
"odoc-parser" {>= "2.0.0"}
"ppx_expect" {>= "v0.15.0" & with-test}
"ocamlformat" {with-test & = "0.24.1"}
"ocamlc-loc" {>= "3.5.0" & < "3.7.0"}
"omd" {>= "1.3.2" & < "2.0.0~alpha1"}
"octavius" {>= "1.2.2"}
"uutf" {>= "1.0.2"}
"pp" {>= "1.1.2"}
"csexp" {>= "1.5"}
Expand Down
Loading

0 comments on commit fe72fab

Please sign in to comment.