add ocaml lsp support (#5230)

This commit is contained in:
Shoubhit Dash
2025-12-09 02:03:45 +05:30
committed by GitHub
parent d22754dd68
commit 20530104ce
3 changed files with 20 additions and 0 deletions

View File

@@ -103,6 +103,8 @@ export const LANGUAGE_EXTENSIONS: Record<string, string> = {
".zig": "zig",
".zon": "zig",
".astro": "astro",
".ml": "ocaml",
".mli": "ocaml",
".tf": "terraform",
".tfvars": "terraform-vars",
".hcl": "hcl",

View File

@@ -1185,6 +1185,23 @@ export namespace LSPServer {
},
}
export const Ocaml: Info = {
id: "ocaml-lsp",
extensions: [".ml", ".mli"],
root: NearestRoot(["dune-project", "dune-workspace", ".merlin", "opam"]),
async spawn(root) {
const bin = Bun.which("ocamllsp")
if (!bin) {
log.info("ocamllsp not found, please install ocaml-lsp-server")
return
}
return {
process: spawn(bin, {
cwd: root,
}),
}
},
}
export const BashLS: Info = {
id: "bash",
extensions: [".sh", ".bash", ".zsh", ".ksh"],