Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

feat(ocaml): add language #373

Merged
merged 1 commit into from
Aug 1, 2022
Merged

Conversation

edwintorok
Copy link
Contributor

Uses https://ocaml.org/p/ocaml-lsp-server/ as language server that can
be installed via opam.

Can be tested if I add this to the Dockerfile:

diff --git a/tools/Dockerfile b/tools/Dockerfile
index 5f2d7ce..e0bc98e 100644
--- a/tools/Dockerfile
+++ b/tools/Dockerfile
@@ -36,6 +36,9 @@ RUN npm i -g chokidar-cli
 # For startup time profiling
 RUN pacman -Sy hyperfine --noconfirm
 
+# OCaml
+RUN pacman -Sy opam diffutils patch ocaml --noconfirm
+
 # Create the doom user and group
 RUN groupadd doom
 RUN useradd -m -g doom doom
@@ -46,6 +49,8 @@ RUN chown -R ${UNAME}:${GNAME} /usr/local/lib/node_modules/
 USER doom
 WORKDIR /home/doom
 
+RUN opam init --disable-sandboxing && opam install ocaml-lsp-server -y
+
 COPY _docker_entry.sh /usr/local/bin/
 
 # Doom-nvim-contrib

And then run eval $(opam env); nvim inside.

I've been using this for quite a while on 3.3.0, but the port to 4.0.1 is still fresh and needs more testing, hence opening as a draft PR.
Please feel free to point out if this is not the way to add a new language.

@connorgmeehan
Copy link
Collaborator

Hey @edwintorok thanks for the PR. This looks perfect, I'll have to test it after work but thank you for the PR :)

@connorgmeehan
Copy link
Collaborator

Just tested it and everything works well for me. Could you add

diff --git a/tools/Dockerfile b/tools/Dockerfile
index 5f2d7ce..e0bc98e 100644
--- a/tools/Dockerfile
+++ b/tools/Dockerfile
@@ -36,6 +36,9 @@ RUN npm i -g chokidar-cli
 # For startup time profiling
 RUN pacman -Sy hyperfine --noconfirm
 
+# OCaml
+RUN pacman -Sy opam diffutils patch ocaml --noconfirm
+
 # Create the doom user and group
 RUN groupadd doom
 RUN useradd -m -g doom doom
@@ -46,6 +49,8 @@ RUN chown -R ${UNAME}:${GNAME} /usr/local/lib/node_modules/
 USER doom
 WORKDIR /home/doom
 
+RUN opam init --disable-sandboxing && opam install ocaml-lsp-server -y
+
 COPY _docker_entry.sh /usr/local/bin/
 
 # Doom-nvim-contrib

to the Dockerfile but leave the changes commented out and leave a message # Required for ocaml language? I think it's worth keeping it in but commented out because it's useful knowledge. Once that's done happy to merge :)

Uses https://ocaml.org/p/ocaml-lsp-server/ as language server that can
be installed via `opam`.

Signed-off-by: Edwin Török <edwin@etorok.net>
@edwintorok edwintorok marked this pull request as ready for review August 1, 2022 09:07
@edwintorok
Copy link
Contributor Author

Thanks, updated the PR (also rebased on top of latest main). BTW the docs say I should create the PR targeting the develop branch, but that branch seems to be way behind, is there another branch I should target instead for new features?

@connorgmeehan connorgmeehan merged commit 50bb8d1 into doom-neovim:main Aug 1, 2022
@connorgmeehan
Copy link
Collaborator

connorgmeehan commented Aug 1, 2022

Thanks @edwintorok! I appreciate these up-streams :)

Edit: nope, main is correct. We're switching to rolling release with tagged stable versions. Thanks for pointing this out, I'm removing references to develop from the docs right now.

molleweide added a commit to molleweide/doom-nvim that referenced this pull request Aug 8, 2022
* main: (73 commits)
  refactor(settings): move settings table into root
  chore: format source code
  fix(explorer): avoid startup warning about unknown option
  fix(explorer): load when editing dir
  fix(netrw): do not disable loading netrw when netrw feature is enabled
  feat(langs,dockerfile): Added Dockerfile language support.
  chore: format source code
  feat(lsp): Enabled ghost_text by default
  chore(docs): Removed references to deprecated `develop` branch.
  chore: format source code
  feat(langs,ocaml): add language (doom-neovim#373)
  chore: format source code
  fix(docker,lsp,core): Dockerfile, lsp warning and preserve_edit_pos (doom-neovim#371)
  fix(linter): Increased formatting timeout.
  fix(lsp): Broken snippet options
  refact(langs): Renamed `snippets` to `extra_snippets`.
  fix(lsp): Fixed some lsps not working when `snippets` module disabled.
  chore(deps): Update pinned packer dependencies
  feat(docs): Added uninstall docs
  fix(logger): Fix when `stdpath('data')` doesn't exist @dwarfmaster doom-neovim#364
  ...
molleweide added a commit to molleweide/doom-nvim that referenced this pull request Aug 9, 2022
* molleweide: (92 commits)
  markdown_tools add plugin
  refactor(settings): move settings table into root
  chore: format source code
  fix(explorer): avoid startup warning about unknown option
  fix(explorer): load when editing dir
  fix(netrw): do not disable loading netrw when netrw feature is enabled
  fix(git): small fix + formatting
  moonfly theme
  add more modules incluing ruby
  feat(langs,dockerfile): Added Dockerfile language support.
  chore: format source code
  feat(lsp): Enabled ghost_text by default
  chore(docs): Removed references to deprecated `develop` branch.
  chore: format source code
  feat(langs,ocaml): add language (doom-neovim#373)
  chore: format source code
  fix(docker,lsp,core): Dockerfile, lsp warning and preserve_edit_pos (doom-neovim#371)
  fix(linter): Increased formatting timeout.
  fix(lsp): Broken snippet options
  refact(langs): Renamed `snippets` to `extra_snippets`.
  ...
@edwintorok edwintorok deleted the feat-ocaml branch December 31, 2022 15:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants