Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix usage of java.import.generatesMetadataFilesAtProjectRoot #482

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

crabbkw
Copy link

@crabbkw crabbkw commented Jul 31, 2024

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 for how this property is read. Also see
eclipse-jdtls/eclipse.jdt.ls#1900 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.

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](eclipse-jdtls/eclipse.jdt.ls#1900 (comment))
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant