-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathlemminx.lua
More file actions
32 lines (30 loc) · 867 Bytes
/
lemminx.lua
File metadata and controls
32 lines (30 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
local M = {}
local lemminx_home = vim.env["LEMMINX_HOME"]
if lemminx_home then
local utils = require("kide.tools")
local me = require("kide.melspconfig")
local lemminx_jars = {}
for _, bundle in ipairs(vim.split(vim.fn.glob(vim.fs.joinpath(lemminx_home, "*.jar")), "\n")) do
table.insert(lemminx_jars, bundle)
end
vim.fn.join(lemminx_jars, utils.is_win and ";" or ":")
M.config = {
name = "lemminx",
cmd = {
utils.java_bin(),
"-cp",
vim.fn.join(lemminx_jars, ":"),
"org.eclipse.lemminx.XMLServerLauncher",
},
settings = {
lemminx = {},
},
filetypes = { "xml", "xsd", "xsl", "xslt", "svg" },
root_dir = vim.fs.root(0, { ".git" }) or vim.uv.cwd(),
single_file_support = true,
on_attach = me.on_attach,
on_init = me.on_init,
capabilities = me.capabilities(),
}
end
return M