Skip to content

Running on Monorepo with multiple Java projects #613

Answered by juhaku
juhaku asked this question in Q&A
Discussion options

You must be logged in to vote

To get back to this as I was refactoring my neovim configs. I this time read carefully that the "key" for the multiple instances of JDTLS language servers problem is the root_dir attribute in the server settings. The find_root does not handle some edge cases or at least I get the result I was not wishing for. However to solve the correct root_dir I tried with the lspconfig.utils.root_pattern function and that solves correctly the root dir for a monorepo case. Here is the working piece:

	root_dir = require("lspconfig").util.root_pattern(
		".git",
		"mvnw",
		"gradlew",
		"pom.xml",
		"build.gradle",
		"build.gradle.kts"
	)(vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf())),

You fi…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by juhaku
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant