ITADN

Fix usage of java.import.generatesMetadataFilesAtProjectRoot

#482Pull Requestcrabbkw 创建于 2024-07-31
C
crabbkwcommented
lsp-java used to treat this as a configuration property of jdtls. However it is not a standard lsp configuration property. Instead it must be passed as a Java System Property on the command line invoking jdtls. See [JLFsUtils.java](https://github.com/eclipse-jdtls/eclipse.jdt.ls/blob/master/org.eclipse.jdt.ls.filesystem/src/org/eclipse/jdt/ls/core/internal/filesystem/JLSFsUtils.java#L192-L197) for how this property is read. Also see [eclipse-jdtls/eclipse.jdt.ls#1900](https://github.com/eclipse-jdtls/eclipse.jdt.ls/pull/1900#issuecomment-974783064) for an explanation of why this is a system property and not a regular LSP configuration property. Use a regular `defcustom` instead of using `lsp-defcustom` for declaring lsp-java-import-generates-metadata-files-at-project-root. Use this defcustom variable in `lsp-java--ls-command` to pass an appropriate value for `java.import.generatesMetadataFilesAtProjectRoot`. With this change importing a Gradle-based java project into LSP will nolonger create `.classpath`, `.settings`, and `.project` entries at the root of the project.
合并状态:未合并 0 条评论