Files
openidea/languages/java.toml
l0ng-ai 1122d67f7d fix(lsp): Deliver server settings and start servers on a supported JDK
- workspace/configuration answers a server's own section (basedpyright)
  from its settings block; basedpyright runs in "standard" mode and keeps
  auto search paths on, so `src/` layouts resolve from `tests/`.
- jdtls: formatting follows the editor indent, calls complete without
  guessed arguments, and JDK internals stay out of completion.
- `max-java` in a language server config picks an installed JDK no newer
  than that (kotlin-language-server fails on JDK 25).
- Server initialization may take up to 5 minutes (first Gradle import).
- `lsp_resend_diagnostics` re-emits stored diagnostics after a reload.
- Spelling only checks declared names (not called methods like
  `substring`) and accepts plurals of known software terms.
2026-10-28 08:28:00 +08:00

53 lines
2.4 KiB
TOML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
id = "java"
name = "Java"
extensions = ["java"]
line-comment = "//"
block-comment = ["/*", "*/"]
indent = { tab-size = 4, insert-spaces = true }
ui-mode = "Java"
tree-sitter = "java"
# Microsoft java-debug runs inside jdtls as a bundle (`initializationOptions.bundles`,
# added when installed); sessions start with `vscode.java.startDebugSession` and the
# client connects to the returned port (`debugServer`).
[debugger]
adapter = "java-debug"
command = "com.microsoft.java.debug.plugin.jar"
transport = "tcp"
install-hint = "Install Microsoft java-debug (Settings › Languages & Frameworks › Language Servers › Java Debugger)"
[[language-servers]]
name = "jdtls"
command = "jdtls"
root-markers = ["pom.xml", "build.gradle", "build.gradle.kts", "settings.gradle", "settings.gradle.kts", "build.xml", ".project"]
install-hint = "Install Eclipse JDT Language Server (brew install jdtls, or https://github.com/eclipse-jdtls/eclipse.jdt.ls); requires JDK 21+"
[language-servers.initialization-options]
bundles = []
[language-servers.initialization-options.extendedClientCapabilities]
# Library classes open as `jdt://` virtual documents (`java/classFileContents`).
classFileContentsSupport = true
resolveAdditionalTextEditsSupport = true
[language-servers.initialization-options.settings.java]
autobuild = { enabled = true }
contentProvider = { preferred = "fernflower" }
maven = { downloadSources = true, updateSnapshots = false }
eclipse = { downloadSources = true }
references = { includeDecompiledSources = true }
signatureHelp = { enabled = true }
configuration = { updateBuildConfiguration = "automatic" }
# Generated code (implement methods, getters, toString…) indents like the editor (`indent` above).
format = { insertSpaces = true, tabSize = 4 }
# Calls complete as `name()` with the caret inside and parameter info, not guessed arguments;
# JDK internals (`sun.*`, `com.sun.*`, `jdk.*`) and AWT's `List` stay out of completion and auto-import.
completion = { guessMethodArguments = "off", filteredTypes = ["java.awt.List", "com.sun.*", "sun.*", "jdk.*", "org.graalvm.*", "io.micrometer.shaded.*"] }
[language-servers.initialization-options.settings.java.import]
# Keep Eclipse metadata (.project, .classpath, .settings) out of the project.
generatesMetadataFilesAtProjectRoot = false
exclusions = ["**/node_modules/**", "**/.metadata/**", "**/archetype-resources/**", "**/META-INF/maven/**"]
maven = { enabled = true }
gradle = { enabled = true, wrapper = { enabled = true } }