Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"jsxSingleQuote": true,
"semi": false
}
6 changes: 6 additions & 0 deletions .vim/coc-settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"typescript.preferences.quoteStyle": "single",
"javascript.preferences.quoteStyle": "single",
"typescript.format.semicolons": "remove",
"javascript.format.semicolons": "remove"
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "coc-java",
"version": "1.26.8",
"version": "1.26.9",
"description": "Java language extension for coc.nvim",
"main": "lib/index.js",
"publisher": "chemzqm",
Expand Down
32 changes: 25 additions & 7 deletions server/bin/jdtls.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,19 @@ def get_java_executable(known_args):
if not known_args.validate_java_version:
return java_executable

java_major_version = get_java_major_version(java_executable)

if java_major_version < 21:
raise Exception("jdtls requires at least Java 21")

return java_executable

def get_java_major_version (java_executable):
out = subprocess.check_output([java_executable, '-version'], stderr = subprocess.STDOUT, universal_newlines=True)

matches = re.finditer(r"(?<=version\s\")(?P<major>\d+)(\.\d+\.\d+(_\d+)?)?", out)
for match in matches:
java_major_version = int(match.group("major"))

if java_major_version < 21:
raise Exception("jdtls requires at least Java 21")

return java_executable
return int(match.group("major"))

raise Exception("Could not determine Java version")

Expand Down Expand Up @@ -75,7 +78,18 @@ def get_shared_config_path(jdtls_base_path):

def main(args):
cwd_name = os.path.basename(os.getcwd())
jdtls_data_path = os.path.join(tempfile.gettempdir(), "jdtls-" + sha1(cwd_name.encode()).hexdigest())

if platform.system() == 'Windows' and 'APPDATA' in os.environ:
cachedir = Path(os.environ['APPDATA'])
elif platform.system() == 'Darwin' and 'HOME' in os.environ:
cachedir = Path(os.environ['HOME']) / 'Library' / 'Caches'
elif platform.system() == 'Linux' and 'HOME' in os.environ:
cachedir = Path(os.environ['HOME']) / '.cache'
else:
cachedir = tempfile.gettempdir()

cachedir = cachedir / 'jdtls'
jdtls_data_path = os.path.join(cachedir, "jdtls-" + sha1(cwd_name.encode()).hexdigest())

parser = argparse.ArgumentParser()
parser.add_argument('--validate-java-version', action='store_true', default=True)
Expand All @@ -89,6 +103,7 @@ def main(args):

known_args, args = parser.parse_known_args(args)
java_executable = get_java_executable(known_args)
java_major_version = get_java_major_version(java_executable)

jdtls_base_path = Path(__file__).parent.parent
shared_config_path = get_shared_config_path(jdtls_base_path)
Expand All @@ -111,6 +126,9 @@ def main(args):
"-data", known_args.data] \
+ args

if (java_major_version >= 24):
exec_args = [ '-Djdk.xml.maxGeneralEntitySizeLimit=0', '-Djdk.xml.totalEntitySizeLimit=0' ] + exec_args

if os.name == 'posix':
os.execvp(java_executable, exec_args)
else:
Expand Down
8 changes: 4 additions & 4 deletions server/config_linux/config.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#This configuration file was written by: org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxFwConfigFileParser
#Thu Sep 04 14:31:14 GMT 2025
#Thu Oct 30 16:35:40 UTC 2025
eclipse.application=org.eclipse.jdt.ls.core.id1
[email protected]/../p2
eclipse.p2.profile=DefaultProfile
eclipse.product=org.eclipse.jdt.ls.core.product
osgi.bundles=reference\:file\:ch.qos.logback.classic_1.5.18.jar@2\:start,reference\:file\:ch.qos.logback.core_1.5.18.jar@4,reference\:file\:com.google.gson_2.13.1.jar@4,reference\:file\:com.google.guava_33.4.8.jre.jar@4,reference\:file\:com.google.guava.failureaccess_1.0.3.jar@4,reference\:file\:com.sun.jna_5.17.0.v20250316-1700/@4,reference\:file\:com.sun.jna.platform_5.17.0.jar@4,reference\:file\:jakarta.annotation-api_1.3.5.jar@4,reference\:file\:jakarta.inject.jakarta.inject-api_1.0.5.jar@4,reference\:file\:jakarta.servlet-api_6.1.0.jar@4,reference\:file\:org.apache.ant_1.10.15.v20240901-1000/@4,reference\:file\:org.apache.aries.spifly.dynamic.bundle_1.3.7.jar@2\:start,reference\:file\:org.apache.commons.cli_1.9.0.jar@4,reference\:file\:org.apache.commons.commons-codec_1.19.0.jar@4,reference\:file\:org.apache.commons.lang3_3.18.0.jar@4,reference\:file\:org.apache.felix.scr_2.2.12.jar@2\:start,reference\:file\:org.commonmark_0.25.1.jar@4,reference\:file\:org.commonmark.ext-gfm-tables_0.25.1.jar@4,reference\:file\:org.eclipse.ant.core_3.7.700.v20250609-0415.jar@4,reference\:file\:org.eclipse.buildship.compat_3.1.10.v20250827-0209-s.jar@4,reference\:file\:org.eclipse.buildship.core_3.1.10.v20250827-0209-s.jar@4,reference\:file\:org.eclipse.compare.core_3.8.800.v20250718-1505.jar@4,reference\:file\:org.eclipse.core.commands_3.12.400.v20250312-0643.jar@4,reference\:file\:org.eclipse.core.contenttype_3.9.700.v20250720-0618.jar@4,reference\:file\:org.eclipse.core.expressions_3.9.500.v20250608-0434.jar@4,reference\:file\:org.eclipse.core.filebuffers_3.8.400.v20250108-1526.jar@4,reference\:file\:org.eclipse.core.filesystem_1.11.300.v20250607-0645.jar@4,reference\:file\:org.eclipse.core.jobs_3.15.700.v20250725-1147.jar@4,reference\:file\:org.eclipse.core.net_1.5.800.v20250613-1119.jar@4,reference\:file\:org.eclipse.core.resources_3.23.0.v20250729-1759.jar@4,reference\:file\:org.eclipse.core.runtime_3.34.0.v20250711-1249.jar@4\:start,reference\:file\:org.eclipse.core.variables_3.6.600.v20250609-0415.jar@4,reference\:file\:org.eclipse.debug.core_3.23.100.v20250811-0711.jar@4,reference\:file\:org.eclipse.equinox.app_1.7.500.v20250629-0337.jar@4,reference\:file\:org.eclipse.equinox.common_3.20.200.v20250628-0509.jar@2\:start,reference\:file\:org.eclipse.equinox.frameworkadmin_2.3.500.v20250716-0529.jar@4,reference\:file\:org.eclipse.equinox.frameworkadmin.equinox_1.3.400.v20250515-0513.jar@4,reference\:file\:org.eclipse.equinox.http.service.api_1.2.102.v20250520-0629.jar@4,reference\:file\:org.eclipse.equinox.launcher_1.7.0.v20250519-0528.jar@4,reference\:file\:org.eclipse.equinox.launcher.gtk.linux.x86_64_1.2.1500.v20250801-0854/@4,reference\:file\:org.eclipse.equinox.preferences_3.12.0.v20250721-0426.jar@4,reference\:file\:org.eclipse.equinox.registry_3.12.500.v20250708-0540.jar@4,reference\:file\:org.eclipse.equinox.security_1.4.700.v20250622-1644.jar@4,reference\:file\:org.eclipse.equinox.security.linux_1.1.400.v20250521-0415.jar@4,reference\:file\:org.eclipse.equinox.simpleconfigurator_1.5.600.v20250606-0550.jar@4,reference\:file\:org.eclipse.equinox.simpleconfigurator.manipulator_2.3.600.v20250729-0655.jar@4,reference\:file\:org.eclipse.jdt.apt.core_3.8.600.v20241001-0914.jar@4,reference\:file\:org.eclipse.jdt.apt.pluggable.core_1.4.600.v20241001-0914.jar@4,reference\:file\:org.eclipse.jdt.core_3.43.0.v20250820-1501.jar@4,reference\:file\:org.eclipse.jdt.core.compiler.batch_3.43.0.v20250819-1513.jar@4,reference\:file\:org.eclipse.jdt.core.javac_1.0.0.z20250903-1655.jar@4,reference\:file\:org.eclipse.jdt.core.manipulation_1.23.100.v20250806-2349.jar@4,reference\:file\:org.eclipse.jdt.debug_3.24.0.v20250729-0743/@4,reference\:file\:org.eclipse.jdt.junit.core_3.13.500.v20250108-1123.jar@4,reference\:file\:org.eclipse.jdt.junit.runtime_3.7.600.v20250118-1031.jar@4,reference\:file\:org.eclipse.jdt.launching_3.23.400.v20250812-0543.jar@4,reference\:file\:org.eclipse.jdt.ls.core_1.50.0.202509041425.jar@4\:start,reference\:file\:org.eclipse.jdt.ls.filesystem_1.50.0.202509041425.jar@4,reference\:file\:org.eclipse.jdt.ls.logback.appender_1.50.0.202509041425.jar@4,reference\:file\:org.eclipse.jetty.servlet-api_4.0.6.jar@4,reference\:file\:org.eclipse.lsp4j_0.24.0.v20250131-1745.jar@4,reference\:file\:org.eclipse.lsp4j.jsonrpc_0.24.0.v20250131-1745.jar@4,reference\:file\:org.eclipse.ltk.core.refactoring_3.15.0.v20241206-0650.jar@4,reference\:file\:org.eclipse.m2e.apt.core_2.3.100.20250418-1315.jar@4,reference\:file\:org.eclipse.m2e.core_2.7.2.20250318-1458.jar@4,reference\:file\:org.eclipse.m2e.jdt_2.4.100.20250418-1315.jar@4,reference\:file\:org.eclipse.m2e.maven.runtime_3.9.900.20250220-2013/@4,reference\:file\:org.eclipse.m2e.workspace.cli_0.4.0.jar@4,reference\:file\:org.eclipse.osgi.services_3.12.300.v20250707-1221.jar@4,reference\:file\:org.eclipse.search.core_3.16.500.v20250611-1642.jar@4,reference\:file\:org.eclipse.text_3.14.400.v20250731-0735.jar@4,reference\:file\:org.eclipse.xtext.xbase.lib_2.40.0.v20250825-0355.jar@4,reference\:file\:org.gradle.toolingapi_8.9.0.v20250827-0209-s.jar@4,reference\:file\:org.hamcrest_3.0.0.jar@4,reference\:file\:org.junit_4.13.2.v20240929-1000.jar@4,reference\:file\:org.objectweb.asm_9.8.0.jar@4,reference\:file\:org.objectweb.asm.commons_9.8.0.jar@4,reference\:file\:org.objectweb.asm.tree_9.8.0.jar@4,reference\:file\:org.objectweb.asm.tree.analysis_9.8.0.jar@4,reference\:file\:org.objectweb.asm.util_9.8.0.jar@4,reference\:file\:org.osgi.service.cm_1.6.1.202109301733.jar@4,reference\:file\:org.osgi.service.component_1.5.1.202212101352.jar@4,reference\:file\:org.osgi.service.device_1.1.1.202109301733.jar@4,reference\:file\:org.osgi.service.event_1.4.1.202109301733.jar@4,reference\:file\:org.osgi.service.http.whiteboard_1.1.1.202109301733.jar@4,reference\:file\:org.osgi.service.metatype_1.4.1.202109301733.jar@4,reference\:file\:org.osgi.service.prefs_1.1.2.202109301733.jar@4,reference\:file\:org.osgi.service.provisioning_1.2.0.201505202024.jar@4,reference\:file\:org.osgi.service.upnp_1.2.1.202109301733.jar@4,reference\:file\:org.osgi.service.useradmin_1.1.1.202109301733.jar@4,reference\:file\:org.osgi.service.wireadmin_1.0.2.202109301733.jar@4,reference\:file\:org.osgi.util.function_1.2.0.202109301733.jar@4,reference\:file\:org.osgi.util.promise_1.3.0.202212101352.jar@4,reference\:file\:slf4j.api_2.0.17.jar@4
osgi.bundles=reference\:file\:ch.qos.logback.classic_1.5.18.jar@2\:start,reference\:file\:ch.qos.logback.core_1.5.18.jar@4,reference\:file\:com.google.gson_2.13.2.jar@4,reference\:file\:com.google.guava_33.5.0.jre.jar@4,reference\:file\:com.google.guava.failureaccess_1.0.3.jar@4,reference\:file\:com.sun.jna_5.18.1.v20251001-0800/@4,reference\:file\:com.sun.jna.platform_5.18.1.jar@4,reference\:file\:jakarta.annotation-api_1.3.5.jar@4,reference\:file\:jakarta.inject.jakarta.inject-api_1.0.5.jar@4,reference\:file\:jakarta.servlet-api_6.1.0.jar@4,reference\:file\:org.apache.ant_1.10.15.v20240901-1000/@4,reference\:file\:org.apache.aries.spifly.dynamic.bundle_1.3.7.jar@2\:start,reference\:file\:org.apache.commons.cli_1.10.0.jar@4,reference\:file\:org.apache.commons.commons-codec_1.19.0.jar@4,reference\:file\:org.apache.commons.lang3_3.19.0.jar@4,reference\:file\:org.apache.felix.scr_2.2.14.jar@2\:start,reference\:file\:org.commonmark_0.27.0.jar@4,reference\:file\:org.commonmark.ext-gfm-tables_0.27.0.jar@4,reference\:file\:org.eclipse.ant.core_3.7.700.v20250609-0415.jar@4,reference\:file\:org.eclipse.buildship.compat_3.1.10.v20250827-0209-s.jar@4,reference\:file\:org.eclipse.buildship.core_3.1.10.v20250827-0209-s.jar@4,reference\:file\:org.eclipse.compare.core_3.8.800.v20250718-1505.jar@4,reference\:file\:org.eclipse.core.commands_3.12.500.v20251023-1511.jar@4,reference\:file\:org.eclipse.core.contenttype_3.9.800.v20250916-0544.jar@4,reference\:file\:org.eclipse.core.expressions_3.9.500.v20250608-0434.jar@4,reference\:file\:org.eclipse.core.filebuffers_3.8.500.v20250916-0924.jar@4,reference\:file\:org.eclipse.core.filesystem_1.11.400.v20251001-1532.jar@4,reference\:file\:org.eclipse.core.jobs_3.15.700.v20250725-1147.jar@4,reference\:file\:org.eclipse.core.net_1.5.800.v20250613-1119.jar@4,reference\:file\:org.eclipse.core.resources_3.23.100.v20251003-1421.jar@4,reference\:file\:org.eclipse.core.runtime_3.34.100.v20250907-1347.jar@4\:start,reference\:file\:org.eclipse.core.variables_3.6.700.v20250913-1442.jar@4,reference\:file\:org.eclipse.debug.core_3.23.200.v20251023-0617.jar@4,reference\:file\:org.eclipse.equinox.app_1.7.500.v20250629-0337.jar@4,reference\:file\:org.eclipse.equinox.common_3.20.300.v20250907-1347.jar@2\:start,reference\:file\:org.eclipse.equinox.frameworkadmin_2.3.500.v20250716-0529.jar@4,reference\:file\:org.eclipse.equinox.frameworkadmin.equinox_1.3.400.v20250515-0513.jar@4,reference\:file\:org.eclipse.equinox.http.service.api_1.2.102.v20250520-0629.jar@4,reference\:file\:org.eclipse.equinox.launcher_1.7.100.v20251014-1222.jar@4,reference\:file\:org.eclipse.equinox.launcher.gtk.linux.x86_64_1.2.1500.v20250801-0854/@4,reference\:file\:org.eclipse.equinox.preferences_3.12.0.v20250721-0426.jar@4,reference\:file\:org.eclipse.equinox.registry_3.12.600.v20250906-0651.jar@4,reference\:file\:org.eclipse.equinox.security_1.4.700.v20250622-1644.jar@4,reference\:file\:org.eclipse.equinox.security.linux_1.1.400.v20250521-0415.jar@4,reference\:file\:org.eclipse.equinox.simpleconfigurator_1.5.700.v20250921-0614.jar@4,reference\:file\:org.eclipse.equinox.simpleconfigurator.manipulator_2.3.600.v20250729-0655.jar@4,reference\:file\:org.eclipse.jdt.apt.core_3.8.600.v20241001-0914.jar@4,reference\:file\:org.eclipse.jdt.apt.pluggable.core_1.4.600.v20241001-0914.jar@4,reference\:file\:org.eclipse.jdt.core_3.44.0.v20251023-1520.jar@4,reference\:file\:org.eclipse.jdt.core.compiler.batch_3.44.0.v20251023-0518.jar@4,reference\:file\:org.eclipse.jdt.core.javac_1.0.0.z20251024-1912.jar@4,reference\:file\:org.eclipse.jdt.core.manipulation_1.23.200.v20251028-1914.jar@4,reference\:file\:org.eclipse.jdt.debug_3.25.0.v20251026-1116/@4,reference\:file\:org.eclipse.jdt.junit.core_3.14.0.v20251027-1451.jar@4,reference\:file\:org.eclipse.jdt.junit.runtime_3.7.600.v20250118-1031.jar@4,reference\:file\:org.eclipse.jdt.launching_3.24.0.v20251006-1045.jar@4,reference\:file\:org.eclipse.jdt.ls.core_1.52.0.202510301627.jar@4\:start,reference\:file\:org.eclipse.jdt.ls.filesystem_1.52.0.202510301627.jar@4,reference\:file\:org.eclipse.jdt.ls.logback.appender_1.52.0.202510301627.jar@4,reference\:file\:org.eclipse.jetty.servlet-api_4.0.6.jar@4,reference\:file\:org.eclipse.lsp4j_0.24.0.v20250131-1745.jar@4,reference\:file\:org.eclipse.lsp4j.jsonrpc_0.24.0.v20250131-1745.jar@4,reference\:file\:org.eclipse.ltk.core.refactoring_3.15.100.v20251023-1358.jar@4,reference\:file\:org.eclipse.m2e.apt.core_2.3.100.20250418-1315.jar@4,reference\:file\:org.eclipse.m2e.core_2.7.4.20250806-1328.jar@4,reference\:file\:org.eclipse.m2e.jdt_2.4.101.20250727-0653.jar@4,reference\:file\:org.eclipse.m2e.maven.runtime_3.9.1100.20250811-2018/@4,reference\:file\:org.eclipse.m2e.workspace.cli_0.4.0.jar@4,reference\:file\:org.eclipse.osgi.services_3.12.300.v20250707-1221.jar@4,reference\:file\:org.eclipse.search.core_3.16.600.v20250920-0652.jar@4,reference\:file\:org.eclipse.text_3.14.500.v20251020-0824.jar@4,reference\:file\:org.eclipse.xtext.xbase.lib_2.41.0.v20251006-0542.jar@4,reference\:file\:org.gradle.toolingapi_8.9.0.v20250827-0209-s.jar@4,reference\:file\:org.hamcrest_3.0.0.jar@4,reference\:file\:org.junit_4.13.2.v20240929-1000.jar@4,reference\:file\:org.objectweb.asm_9.9.0.jar@4,reference\:file\:org.objectweb.asm.commons_9.9.0.jar@4,reference\:file\:org.objectweb.asm.tree_9.9.0.jar@4,reference\:file\:org.objectweb.asm.tree.analysis_9.9.0.jar@4,reference\:file\:org.objectweb.asm.util_9.9.0.jar@4,reference\:file\:org.osgi.service.cm_1.6.1.202109301733.jar@4,reference\:file\:org.osgi.service.component_1.5.1.202212101352.jar@4,reference\:file\:org.osgi.service.device_1.1.1.202109301733.jar@4,reference\:file\:org.osgi.service.event_1.4.1.202109301733.jar@4,reference\:file\:org.osgi.service.http.whiteboard_1.1.1.202109301733.jar@4,reference\:file\:org.osgi.service.metatype_1.4.1.202109301733.jar@4,reference\:file\:org.osgi.service.prefs_1.1.2.202109301733.jar@4,reference\:file\:org.osgi.service.provisioning_1.2.0.201505202024.jar@4,reference\:file\:org.osgi.service.upnp_1.2.1.202109301733.jar@4,reference\:file\:org.osgi.service.useradmin_1.1.1.202109301733.jar@4,reference\:file\:org.osgi.service.wireadmin_1.0.2.202109301733.jar@4,reference\:file\:org.osgi.util.function_1.2.0.202109301733.jar@4,reference\:file\:org.osgi.util.promise_1.3.0.202212101352.jar@4,reference\:file\:slf4j.api_2.0.17.jar@4
osgi.bundles.defaultStartLevel=4
osgi.framework=file\:plugins/org.eclipse.osgi_3.23.200.v20250812-1847.jar
osgi.framework.extensions=reference\:file\:org.eclipse.osgi.compatibility.state_1.2.1200.v20250506-0416.jar
osgi.framework=file\:plugins/org.eclipse.osgi_3.24.0.v20251022-1724.jar
osgi.framework.extensions=reference\:file\:org.eclipse.osgi.compatibility.state_1.3.0.v20251022-1724.jar
Loading