Skip to content

spring-boot LS does not work and does not show up in lsp logs #28

Description

@keen-dot-dev

Issue:

:checkhealth vim.lsp command never shows spring-boot LS and suggestions do not work in application.yml/application.properties.

Description:

My setup:

  1. vscode-spring-boot-tools and jdtls installed with Mason.
  2. nvim-jdtls setup with ftplugin.
  3. lazy.nvim configuration for nvim-jdtls and spring-boot.nvim:
{
    "mfussenegger/nvim-jdtls",
    dependencies = { "mfussenegger/nvim-dap" }
},
{
    "JavaHello/spring-boot.nvim",
    dependencies = { "mfussenegger/nvim-jdtls" },
    lazy = true,
    opts = {}
}
  1. My ftplugin config for java and yaml:
local data_path = "..." -- path to constructed data directory for the project
local jdtls_bin = "..." -- path to JDTLS binary
local lombok_jar = "..." -- path to Lombok jar
local bundles = {}
vim.list_extend(bundles, require("spring_boot").java_extensions())
vim.list_extend(bundles, vim.split(vim.fn.glob(".../vscode-java-test/server/*.jar"), "\n"))
vim.list_extend(bundles, vim.split(vim.fn.glob(".../java-debug/com.microsoft.java.debug.plugin/target/*.jar"), "\n"))
jdtls.start_or_attach({
    cmd = {
        jdtls_bin,
        "--jvm-arg=-javaagent:" .. lombok_jar,
        "-data", data_path
    },
    root_dir = vim.fs.dirname(vim.fs.find({ "gradlew", ".git", "mvnw" }, { upward = true })[1]),
    init_options = { bundles = bundles }
})
  1. The jdtls LS works well, completion in java files is present, no issues. The :checkhealth vim.lsp command always show it properly. java-test setup and debugging also work fine.

The problem:

  1. The spring-boot LS never shows up in :checkhealth vim.lsp or lsp.log .
  2. Sometimes when I open java or yaml file I get the message Spring Boot LS is not installed.
    (I can fix this one by manually providing ls_path to the opts in spring-boot.nvim configuration, but it looks like something else is wrong)

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