Skip to content
This repository has been archived by the owner on Feb 8, 2025. It is now read-only.

Commit

Permalink
ag
Browse files Browse the repository at this point in the history
  • Loading branch information
dabeycorn committed May 3, 2024
1 parent 5c50cc7 commit a7145a8
Show file tree
Hide file tree
Showing 7 changed files with 177 additions and 4 deletions.
125 changes: 125 additions & 0 deletions ftplugin/java.nope
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
-- If you started neovim within `~/dev/xy/project-1` this would resolve to `project-1`
local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ':p:h:t')

local workspace_dir = '/path/to/workspace-root/' .. project_name

local jdtls = require('jdtls')

-- See `:help vim.lsp.start_client` for an overview of the supported `config` options.
local opts = {
-- The command that starts the language server
-- See: https://github.com/eclipse/eclipse.jdt.ls#running-from-the-command-line
cmd = {

-- 💀
'/usr/lib/jvm/java-17-openjdk/bin/java', -- or '/path/to/java17_or_newer/bin/java'
-- depends on if `java` is in your $PATH env variable and if it points to the right version.

'-Declipse.application=org.eclipse.jdt.ls.core.id1',
'-Dosgi.bundles.defaultStartLevel=4',
'-Declipse.product=org.eclipse.jdt.ls.core.product',
'-Dlog.protocol=true',
'-Dlog.level=ALL',
'-Xmx1g',
'--add-modules=ALL-SYSTEM',
'--add-opens', 'java.base/java.util=ALL-UNNAMED',
'--add-opens', 'java.base/java.lang=ALL-UNNAMED',

-- 💀
'-jar', '/home/dabeycorn/.local/share/jdtls/plugins/org.eclipse.equinox.launcher_1.6.800.v20240304-1850.jar',
-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
-- Must point to the Change this to
-- eclipse.jdt.ls installation the actual version


-- 💀
'-configuration', '/home/dabeycorn/.local/share/jdtls/config_linux',
-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^
-- Must point to the Change to one of `linux`, `win` or `mac`
-- eclipse.jdt.ls installation Depending on your system.


-- 💀
-- See `data directory configuration` section in the README
'-data', '/mnt/dasuns_data/data/projects/2024-Competition-Robot',
},

-- 💀
-- This is the default if not provided, you can remove it. Or adjust as needed.
-- One dedicated LSP server & client will be started per unique root_dir
root_dir = require('jdtls.setup').find_root({'.git', 'mvnw', 'gradlew', "pom.xml", "build.gradle"}),

-- Here you can configure eclipse.jdt.ls specific settings
-- See https://github.com/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request
-- for a list of options
settings = {
java = {
eclipse = {
downloadSources = true;
},
maven = {
downloadSources = true,
},
gradle = {
downloadSources = true,
},
implementationsCodeLens = {
enabled = true,
},
referencesCodeLens = {
enabled = true,
},
sources = {
organizeImports = {
starThreshold = 9999,
staticStarThreshold = 9999,
},
},
configuration = {
updateBuildConfiguration = 'interactive',
runtimes = {
{
name = "JavaSE-1.8",
path = "/lib/jvm/default-runtime",
-- path = "/Library/Java/JavaVirtualMachines/amazon-corretto-8.jdk/Contents/Home",
default = true,
},
},
},
},
signatureHelp = { enabled = true },
completion = {
enabled = true,
favoriteStaticMembers = {},
filteredTypes = {
-- "com.sun.*",
-- "io.micrometer.shaded.*",
-- "java.awt.*",
-- "jdk.*",
-- "sun.*",
},
},
codeGeneration = {
toString = {
template = "${object.className}{${member.name()}=${member.value}, ${otherMembers}}",
},
useBlocks = true,
},
init_options = {
bundles = {}
}
},
-- Language server `initializationOptions`
-- You need to extend the `bundles` with paths to jar files
-- if you want to use additional eclipse.jdt.ls plugins.
--
-- See https://github.com/mfussenegger/nvim-jdtls#java-debug-installation
--
-- If you don't plan on using the debugger or other eclipse.jdt.ls plugins you can remove this
--init_options = {
-- bundles = path.bundles,
--},
}
-- This starts a new client & server,
-- or attaches to an existing client & server depending on the `root_dir`.
require('jdtls').start_or_attach(opts)
9 changes: 9 additions & 0 deletions lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,19 @@
"gruvboxed": { "branch": "mega", "commit": "93f07d7893f94d850c9dfb6ae16bf84f3813022f" },
"kanagawa.nvim": { "branch": "master", "commit": "bfa818c7bf6259152f1d89cf9fbfba3554c93695" },
"lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" },
"lsp_signature.nvim": { "branch": "master", "commit": "c6aeb2f1d2538bbdfdaab1664d9d4c3c75aa9db8" },
"lua-async-await": { "branch": "main", "commit": "652d94df34e97abe2d4a689edbc4270e7ead1a98" },
"lualine.nvim": { "branch": "master", "commit": "b5e8bb642138f787a2c1c5aedc2a78cb2cebbd67" },
"lush.nvim": { "branch": "main", "commit": "bc12f010b34cfeefac35720656eb777753b165d9" },
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" },
"nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" },
"nvim-cmp": { "branch": "main", "commit": "2fb2a3cf78bbc1b0bea030e8c8728985af1cf302" },
"nvim-dap": { "branch": "master", "commit": "6ae8a14828b0f3bff1721a35a1dfd604b6a933bb" },
"nvim-hlslens": { "branch": "main", "commit": "c42b4526e6d83b904eb5f3d50e68d7c2fc4be4b5" },
"nvim-java": { "branch": "main", "commit": "f53dc51322aeb9270bc7bef569f99f06730c8a01" },
"nvim-java-core": { "branch": "main", "commit": "dcb11708a4459125da8dfa171ee19a11fbd03312" },
"nvim-java-dap": { "branch": "main", "commit": "55c90c5d2414f6e66f843f38e111bee284d71e61" },
"nvim-java-test": { "branch": "main", "commit": "a3fe70c48936e1c143ed366e127e9c3db4791716" },
"nvim-lspconfig": { "branch": "master", "commit": "f4619ab31fc4676001ea05ae8200846e6e7700c7" },
"nvim-tree.lua": { "branch": "master", "commit": "ddd1d6eb21c45433bdc65cc8015f2457998f2bf2" },
"nvim-treesitter": { "branch": "master", "commit": "6e0b031ebb212e7082bc3007f8b9614cb393465c" },
Expand Down
9 changes: 9 additions & 0 deletions lua/mappings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,12 @@ vim.keymap.set('n', '<leader>tc', "<Cmd>NvimTreeCollapse<CR>", {silent = true})
vim.keymap.set('n', '<leader>tl', "<Cmd>NvimTreeFindFile<CR>", {silent = true})

-- hlslens Binds
vim.keymap.set('n', '<leader>h', [[*<Cmd>lua require('hlslens').start()<CR>]], {noremap = true, silent = true})

-- signature Binds
vim.keymap.set({ 'n' }, '<C-k>', function() require('lsp_signature').toggle_float_win()
end, { silent = true, noremap = true, desc = 'toggle signature' })

vim.keymap.set({ 'n' }, '<Leader>k', function()
vim.lsp.buf.signature_help()
end, { silent = true, noremap = true, desc = 'toggle signature' })
5 changes: 4 additions & 1 deletion lua/plugins/cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ return {
'hrsh7th/cmp-nvim-lua',
'lukas-reineke/cmp-rg',
"neovim/nvim-lspconfig",

--[[{
'onsails/lspkind-nvim',
config = function()
Expand Down Expand Up @@ -112,6 +113,8 @@ return {
};
}
}
require('lspconfig')['jdtls'].setup{}
require('lspconfig')['jdtls'].setup{

}
end
}
21 changes: 21 additions & 0 deletions lua/plugins/java.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
return {
'nvim-java/nvim-java',
dependencies = {
'nvim-java/lua-async-await',
'nvim-java/nvim-java-core',
'nvim-java/nvim-java-test',
'nvim-java/nvim-java-dap',
'MunifTanjim/nui.nvim',
'neovim/nvim-lspconfig',
'mfussenegger/nvim-dap',
{
'williamboman/mason.nvim',
opts = {
registries = {
'github:nvim-java/mason-registry',
'github:mason-org/mason-registry',
},
},
}
},
}
6 changes: 6 additions & 0 deletions lua/plugins/lspSignature.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
return {
"ray-x/lsp_signature.nvim",
event = "VeryLazy",
opts = {},
config = function(_, opts) require'lsp_signature'.setup(opts) end
}
6 changes: 3 additions & 3 deletions lua/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ vim.wo.signcolumn = 'yes'
vim.wo.wrap = false
vim.opt.timeoutlen = 500

vim.diagnostic.config({
virtual_text = false,
})
--vim.diagnostic.config({
-- virtual_text = false,
--})

0 comments on commit a7145a8

Please sign in to comment.