Skip to content

'spring-boot' config not found. Ensure that vim.lsp.config('spring-boot') was called. #33

Open

Description

@minh2134

My current configuration:

return {
	{
		'https://github.com/mfussenegger/nvim-jdtls',
		config = function()
			local fname =  vim.api.nvim_buf_get_name(0)
			local root_dir = vim.fs.root(fname, vim.lsp.config.jdtls.root_markers)
			local project_name = root_dir and vim.fs.basename(root_dir)

			local cmd = { 
				"jdtls", 
			}
			if project_name then
				vim.list_extend(cmd, {
					"-configuration", vim.fn.stdpath("cache") .. "/jdtls/" .. project_name .. "/config",
					"-data", vim.fn.stdpath("cache") .. "/jdtls/" .. project_name .. "/data",
				})
			end

			vim.lsp.config("jdtls", {
				-- NOTE: move to opts in the main object if this gets out of hands
				cmd = cmd,
				settings = {
					java = {
						format = {
							enabled = true
						}
					}
				},
			})
		end,
	},
	{
		"JavaHello/spring-boot.nvim",
		ft = { "java", "yaml", "jproperties" },
		dependencies = {
			"mfussenegger/nvim-jdtls", -- or nvim-java, nvim-lspconfig
			-- might want to add telescope.nvim in the future
		},
		---@type bootls.Config
		opts = {
			project_filter = function(root_dir)
				return require("spring_boot.util").has_spring_boot_dependency(root_dir)
			end,
		},
		config = function()
			vim.lsp.config("jdtls", {
				init_options = {
					bundles = require("spring_boot").java_extensions()
				}
			})
			vim.lsp.enable("jdtls")
		end
	}
}

(it's janky, i know)
Currently I can fireup jdtls just fine, and I know there is some effort to load spring-boot.nvim, as I do get "No Spring Boot LS found" before i installed the LS using mason.nvim. However when I check :checkhealth vim.lsp, there is no spring boot lsp attached and the enabled configuration complained like the title:

- ⚠️ WARNING 'spring-boot' config not found. Ensure that vim.lsp.config('spring-boot') was called.
- spring-boot:

Activity

  1. JavaHello commented on Nov 2, 2026

    @JavaHello
    Owner

    Lazy.nvim does not automatically call the plugin's setup(opts) when you provide a custom config function.

    You need to initialize the plugin manually:

    config = function(_, opts)
        require("spring_boot").setup(opts)
    end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions