aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorPeter Lithammer <peter.lithammer@gmail.com>2021-05-19 08:32:01 +0200
committerGitHub <noreply@github.com>2021-05-19 08:32:01 +0200
commit33a04f6457b1cddd13ffb5f97f4d12f5e216eb21 (patch)
treee39ff130829a9eb7b3da12cf92d3d7ec05629b9f /lua
parent[docgen] Update CONFIG.md (diff)
parentocamllsp: add more filetypes (diff)
downloadnvim-lspconfig-33a04f6457b1cddd13ffb5f97f4d12f5e216eb21.tar
nvim-lspconfig-33a04f6457b1cddd13ffb5f97f4d12f5e216eb21.tar.gz
nvim-lspconfig-33a04f6457b1cddd13ffb5f97f4d12f5e216eb21.tar.bz2
nvim-lspconfig-33a04f6457b1cddd13ffb5f97f4d12f5e216eb21.tar.lz
nvim-lspconfig-33a04f6457b1cddd13ffb5f97f4d12f5e216eb21.tar.xz
nvim-lspconfig-33a04f6457b1cddd13ffb5f97f4d12f5e216eb21.tar.zst
nvim-lspconfig-33a04f6457b1cddd13ffb5f97f4d12f5e216eb21.zip
Merge pull request #912 from undu/ocaml_interface
Add multiple types for ocamllsp
Diffstat (limited to 'lua')
-rw-r--r--lua/lspconfig/ocamllsp.lua19
1 files changed, 18 insertions, 1 deletions
diff --git a/lua/lspconfig/ocamllsp.lua b/lua/lspconfig/ocamllsp.lua
index 155ec1c8..5ce8441d 100644
--- a/lua/lspconfig/ocamllsp.lua
+++ b/lua/lspconfig/ocamllsp.lua
@@ -1,11 +1,28 @@
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'
+local language_id_of = {
+ menhir = 'ocaml.menhir';
+ ocaml = 'ocaml';
+ ocamlinterface = 'ocaml.interface';
+ ocamllex = 'ocaml.ocamllex';
+ reason = 'reason';
+}
+
+local filetypes = {}
+
+for ftype, _ in pairs(language_id_of) do
+ table.insert(filetypes, ftype)
+end
+
+local get_language_id = function (_, ftype) return language_id_of[ftype] end
+
configs.ocamllsp = {
default_config = {
cmd = {"ocamllsp",};
- filetypes = {'ocaml', 'reason'};
+ filetypes = filetypes;
root_dir = util.root_pattern("*.opam", "esy.json", "package.json", ".git");
+ get_language_id = get_language_id;
};
docs = {
description = [[