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

generatesMetadataFilesAtProjectRoot do not work #3582

Closed
zaiqiang-dong opened this issue Jan 22, 2025 · 2 comments
Closed

generatesMetadataFilesAtProjectRoot do not work #3582

zaiqiang-dong opened this issue Jan 22, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@zaiqiang-dong
Copy link

zaiqiang-dong commented Jan 22, 2025

Description

my config as below:

			require("lspconfig").jdtls.setup({
				init_options = {
					settings = {
						java = {
							configuration = {
								updateBuildConfiguration = "disabled",
							},
							implementationsCodeLens = { enabled = true },
							file = {
								exclude = false,
							},
							import = { -- <- this
								generatesMetadataFilesAtProjectRoot = false,
							},
						},
					},
				},
			})

I don't want to generate project settings files (.project, .classpath, .factorypath, .settings/) so I configured generatesMetadataFilesAtProjectRoot = false, but these files are still generated

@zaiqiang-dong zaiqiang-dong added the bug Something isn't working label Jan 22, 2025
@lithammer
Copy link
Collaborator

I'm not familiar with jdtls, but settings probably shouldn't be nested under init_options. You likely want either this:

setup({
  init_options = {
    java = {
      import = {
        generatesMetadataFilesAtProjectRoot = false
      }
    }
  }
})

Or this (most likely):

setup({
  settings = {
    java = {
      import = {
        generatesMetadataFilesAtProjectRoot = false
      }
    }
  }
})

@justinmk justinmk closed this as not planned Won't fix, can't repro, duplicate, stale Jan 22, 2025
@zaiqiang-dong
Copy link
Author

zaiqiang-dong commented Jan 23, 2025

i have change config as bellow but can not work fine also.

require("lspconfig").jdtls.setup({
	settings = {
		java = {
			implementationsCodeLens = { enabled = true },
			import = { -- <- this
				generatesMetadataFilesAtProjectRoot = false,
				gradle = {
					enabled = true,
					wrapper = {
						enabled = true,
					},
				},
			},
		},
	},
	init_options = {
		jvm_args = {},
	},
})

jdtls has surport it and vscode-java suport it

@justinmk @lithammer please check it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants