removed java ftplugin file, as mason-ls now does not need one.

This commit is contained in:
Gabe Venberg 2023-03-10 13:18:30 -06:00
parent e125110fee
commit 484c48c916
4 changed files with 8 additions and 86 deletions

View file

@ -1,82 +0,0 @@
local opts = {
cmd = {},
settings = {
java = {
signatureHelp = { enabled = true },
completion = {
favoriteStaticMembers = {},
filteredTypes = {
-- "com.sun.*",
-- "io.micrometer.shaded.*",
-- "java.awt.*",
-- "jdk.*",
-- "sun.*",
},
},
sources = {
organizeImports = {
starThreshold = 9999,
staticStarThreshold = 9999,
},
},
codeGeneration = {
toString = {
template = "${object.className}{${member.name()}=${member.value}, ${otherMembers}}",
},
useBlocks = true,
},
configuration = {
runtimes = {
{
name = "JavaSE-1.8",
path = "/Library/Java/JavaVirtualMachines/amazon-corretto-8.jdk/Contents/Home",
default = true,
},
{
name = "JavaSE-17",
path = "/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home",
},
{
name = "JavaSE-19",
path = "/Library/Java/JavaVirtualMachines/jdk-19.jdk/Contents/Home",
},
},
},
},
},
}
local jdtls_config = opts
local pkg_status, jdtls = pcall(require,"jdtls")
if not pkg_status then
vim.notify("unable to load nvim-jdtls", "error")
return {}
end
-- local jdtls_path = vim.fn.stdpath("data") .. "/mason/packages/jdtls"
local jdtls_bin = vim.fn.stdpath("data") .. "/mason/bin/jdtls"
local root_markers = { ".gradle", "gradlew", ".git" }
local root_dir = jdtls.setup.find_root(root_markers)
local home = os.getenv("HOME")
local project_name = vim.fn.fnamemodify(root_dir, ":p:h:t")
local workspace_dir = home .. "/.cache/jdtls/workspace/" .. project_name
opts.cmd = {
jdtls_bin,
"-data",
workspace_dir,
}
local on_attach = function(client, bufnr)
jdtls.setup.add_commands() -- important to ensure you can update configs when build is updated
-- if you setup DAP according to https://github.com/mfussenegger/nvim-jdtls#nvim-dap-configuration you can uncomment below
-- jdtls.setup_dap({ hotcodereplace = "auto" })
-- jdtls.dap.setup_dap_main_class_configs()
-- you may want to also run your generic on_attach() function used by your LSP config
end
opts.on_attach = on_attach
opts.capabilities = vim.lsp.protocol.make_client_capabilities()
jdtls.start_or_attach(jdtls_config)

View file

@ -38,8 +38,8 @@ require("mason-lspconfig").setup_handlers({
require('rust-tools-setup')
on_attach()
end,
["sumneko_lua"] = function()
require('lspconfig').sumneko_lua.setup {
["lua_ls"] = function()
require('lspconfig').lua_ls.setup {
settings = {
Lua = {
diagnostics = {

View file

@ -44,8 +44,8 @@ return require('packer').startup(function(use)
config = function()
require("mason-lspconfig").setup({
ensure_installed = {
"sumneko_lua",
"rust_analyzer",
'lua_ls',
'rust_analyzer',
'pyright',
'bashls',
'texlab',

View file

@ -20,3 +20,7 @@ FTL
superintelligent
homeworld
toolchain
Kata
ctl
NDSU
rebasing