diff --git a/Makefile b/Makefile index 8764344b..26420bd2 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,9 @@ clean: doc: @dune build @doc +update-submodules: + @git submodule update --init + VERSION=$(shell awk '/^version:/ {print $$2}' linol.opam) update_next_tag: diff --git a/example/template-eio/main.ml b/example/template-eio/main.ml index 932e0cfa..88f01b3a 100644 --- a/example/template-eio/main.ml +++ b/example/template-eio/main.ml @@ -15,6 +15,8 @@ of a document are expected to be able to return. *) +module Lsp = Linol.Lsp + type state_after_processing = unit let process_some_input_file (_file_contents : string) : state_after_processing = diff --git a/example/template-lwt/main.ml b/example/template-lwt/main.ml index 42e0ea26..5e952ffb 100644 --- a/example/template-lwt/main.ml +++ b/example/template-lwt/main.ml @@ -15,6 +15,8 @@ of a document are expected to be able to return. *) +module Lsp = Linol.Lsp + type state_after_processing = unit let process_some_input_file (_file_contents : string) : state_after_processing = diff --git a/src/common_.ml b/src/common_.ml index 78a5810a..d883a936 100644 --- a/src/common_.ml +++ b/src/common_.ml @@ -1,3 +1,5 @@ +module Lsp = Linol_lsp.Lsp +module Jsonrpc = Linol_jsonrpc.Jsonrpc module Trace = Trace_core let ( let@ ) = ( @@ ) diff --git a/src/dune b/src/dune index 8e81d40c..6c66594f 100644 --- a/src/dune +++ b/src/dune @@ -3,4 +3,4 @@ (public_name linol) (private_modules log) (flags :standard -warn-error -a+8) - (libraries yojson logs threads trace.core lsp jsonrpc)) + (libraries yojson logs threads trace.core (re_export linol.lsp) (re_export linol.jsonrpc))) diff --git a/src/eio/linol_eio.ml b/src/eio/linol_eio.ml index a3cb606c..a95ea20a 100644 --- a/src/eio/linol_eio.ml +++ b/src/eio/linol_eio.ml @@ -1,3 +1,7 @@ +open struct + module Lsp = Linol_lsp.Lsp +end + module type IO = Linol.IO module IO_eio : diff --git a/src/jsonrpc2.mli b/src/jsonrpc2.mli index 2ed46b04..4f96e796 100644 --- a/src/jsonrpc2.mli +++ b/src/jsonrpc2.mli @@ -2,6 +2,7 @@ See {{: https://www.jsonrpc.org/specification} the spec} *) +open Common_ type json = Yojson.Safe.t module type IO = Sigs.IO diff --git a/src/linol.ml b/src/linol.ml index b9bb632c..3d841d54 100644 --- a/src/linol.ml +++ b/src/linol.ml @@ -3,13 +3,16 @@ Abstraction over The "Lsp" library, to make it easier to develop LSP servers in OCaml (but not necessarily {b for} OCaml). *) -module Imports = struct - module Lsp = Lsp - module Jsonrpc = Jsonrpc -end module type IO = Sigs.IO +(** {2 Re-export from vendored lsp} *) + +module Lsp = Linol_lsp.Lsp +module Jsonrpc = Linol_jsonrpc.Jsonrpc + +(** {2 Main modules} *) + module Jsonrpc2 = Jsonrpc2 module Server = Server module Blocking_IO = Blocking_IO diff --git a/src/lwt/linol_lwt.ml b/src/lwt/linol_lwt.ml index 432527bf..d295fe29 100644 --- a/src/lwt/linol_lwt.ml +++ b/src/lwt/linol_lwt.ml @@ -1,3 +1,7 @@ +open struct + module Lsp = Linol_lsp.Lsp +end + module type IO = Linol.IO module IO_lwt : diff --git a/vendor/jsonrpc/dune b/vendor/jsonrpc/dune index 28e23310..8429aec2 100644 --- a/vendor/jsonrpc/dune +++ b/vendor/jsonrpc/dune @@ -1,5 +1,5 @@ (copy_files %{project_root}/submodules/ocaml-lsp/jsonrpc/src/*.{ml,mli}) (library - (name jsonrpc) + (name linol_jsonrpc) (public_name linol.jsonrpc)) diff --git a/vendor/lsp/dune b/vendor/lsp/dune index 95ebe38e..8e6d1ae4 100644 --- a/vendor/lsp/dune +++ b/vendor/lsp/dune @@ -1,9 +1,10 @@ (copy_files %{project_root}/submodules/ocaml-lsp/lsp/src/*.{ml,mli,mll}) (library - (name lsp) + (name linol_lsp) (public_name linol.lsp) - (libraries jsonrpc ppx_yojson_conv_lib uutf yojson) + (libraries linol_jsonrpc ppx_yojson_conv_lib uutf yojson) + (flags :standard -open Linol_jsonrpc) (lint (pps ppx_yojson_conv)))