formatting
This commit is contained in:
@ -11,7 +11,8 @@ local java_dap_install = vim.fs.joinpath(vim.fn.stdpath('data'),
|
|||||||
local config = {
|
local config = {
|
||||||
cmd = {
|
cmd = {
|
||||||
"/usr/lib/jvm/openjdk21/bin/java", -- 💀
|
"/usr/lib/jvm/openjdk21/bin/java", -- 💀
|
||||||
"-jar", vim.fn.glob(jdtls_install.."/plugins/org.eclipse.equinox.launcher_*.jar"), -- 💀
|
"-jar", -- 💀
|
||||||
|
vim.fn.glob(jdtls_install.."/plugins/org.eclipse.equinox.launcher_*.jar"),
|
||||||
"-configuration", jdtls_install.."/config_linux",
|
"-configuration", jdtls_install.."/config_linux",
|
||||||
"-data", vim.fn.stdpath("cache").."/nvim-jdtls",
|
"-data", vim.fn.stdpath("cache").."/nvim-jdtls",
|
||||||
|
|
||||||
@ -79,10 +80,12 @@ local config = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
-- generate the path to the java file(s)
|
-- generate the path to the java file(s)
|
||||||
---@type string|nil
|
---@type string?
|
||||||
local cache_path = vim.fs.joinpath(vim.fn.stdpath("cache"), "/JavaVersion.class")
|
local cache_path = vim.fs.joinpath(vim.fn.stdpath("cache"),
|
||||||
---@type string|nil
|
"/JavaVersion.class")
|
||||||
local src_path = vim.fs.joinpath(vim.fn.stdpath("config"), "/extras/JavaVersion.java")
|
---@type string?
|
||||||
|
local src_path = vim.fs.joinpath(vim.fn.stdpath("config"),
|
||||||
|
"/extras/JavaVersion.java")
|
||||||
|
|
||||||
-- if either path is invalid
|
-- if either path is invalid
|
||||||
if not cache_path or not src_path then
|
if not cache_path or not src_path then
|
||||||
@ -99,7 +102,8 @@ local function build_cache()
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- compile our code
|
-- compile our code
|
||||||
vim.system({ "javac", src_path, "-d", vim.fn.stdpath("cache") }, {}, function(out)
|
vim.system({ "javac", src_path, "-d", vim.fn.stdpath("cache"), }, {},
|
||||||
|
function(out)
|
||||||
if out.code ~= 0 then
|
if out.code ~= 0 then
|
||||||
cache_path = nil
|
cache_path = nil
|
||||||
end
|
end
|
||||||
@ -142,7 +146,7 @@ local function version_check()
|
|||||||
elseif v.major < 21 then
|
elseif v.major < 21 then
|
||||||
vim.notify(string.format(
|
vim.notify(string.format(
|
||||||
"java version %s < 21.0.0 Cannot run jdtls, bailing out",
|
"java version %s < 21.0.0 Cannot run jdtls, bailing out",
|
||||||
v[1] .. "." .. v[2] .. "." .. v[3]),
|
v[1].."."..v[2].."."..v[3]),
|
||||||
vim.log.levels.ERROR, { title = misc.appid })
|
vim.log.levels.ERROR, { title = misc.appid })
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
@ -16,5 +16,6 @@ end)
|
|||||||
-- change neovim root
|
-- change neovim root
|
||||||
map_local("n", "rt", function()
|
map_local("n", "rt", function()
|
||||||
vim.api.nvim_set_current_dir(vim.b.netrw_curdir)
|
vim.api.nvim_set_current_dir(vim.b.netrw_curdir)
|
||||||
vim.notify("root dir updated: "..vim.b.netrw_curdir, vim.log.levels.LOW, { title = misc.appid })
|
vim.notify("root dir updated: "..vim.b.netrw_curdir, vim.log.levels.LOW,
|
||||||
|
{ title = misc.appid })
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user