This repository has been archived by the owner on Feb 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
177 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
}, | ||
}, | ||
} | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters