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') require('rust-tools-setup')
on_attach() on_attach()
end, end,
["sumneko_lua"] = function() ["lua_ls"] = function()
require('lspconfig').sumneko_lua.setup { require('lspconfig').lua_ls.setup {
settings = { settings = {
Lua = { Lua = {
diagnostics = { diagnostics = {

View file

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

View file

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