From 44cc0635bc3d2ccc55eb76bc7668092befcf0536 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Tue, 16 Sep 2025 12:45:46 +0300 Subject: [PATCH] fix(ocaml): use `root_dir` instead of `root_markers` for globs support (#6428) ## Description As per [comment](https://github.com/LazyVim/LazyVim/commit/23b9cdeb3471b655532e9884fa2dd36ee83062d5#r165830889), use `root_dir` with `util.root_pattern` instead of `root_markers` for globs support. I don't actually do Ocaml to thoroughly test it, but it should work in theory :stuck_out_tongue: ## Related Issue(s) None ## Screenshots ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/ocaml.lua | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/ocaml.lua b/lua/lazyvim/plugins/extras/lang/ocaml.lua index a8de495c..0e733a4a 100644 --- a/lua/lazyvim/plugins/extras/lang/ocaml.lua +++ b/lua/lazyvim/plugins/extras/lang/ocaml.lua @@ -26,15 +26,12 @@ return { "reason", "dune", }, - root_markers = { - "*.opam", - "esy.json", - "package.json", - ".git", - "dune-project", - "dune-workspace", - "*.ml", - }, + root_dir = function(bufnr, on_dir) + local util = require("lspconfig.util") + local fname = vim.api.nvim_buf_get_name(bufnr) + --stylua: ignore + on_dir(util.root_pattern("*.opam", "esy.json", "package.json", ".git", "dune-project", "dune-workspace", "*.ml")( fname)) + end, }, }, },