Skip to main content
Back to Extensions Directory
coc.nvim fallback icon

coc-springboot

asmodeus812

Coc spring boot language server extension client

Installation CommandVim prompt
:CocInstall coc-springboot
GitHub owner
asmodeus812
Version
v0.2.6
npm package
coc-springboot
Requirements
coc >=0.0.82
License
GPL-3.0-only
Repository
GitHub
npm latest published 2026-11-21Registry summary

Published Package Summary

coc-springboot

Spring Boot support for coc.nvim. The extension runs the Spring Boot language server of the Spring Tools project inside Neovim: Spring aware completion, hover and validation for Java files and for application.properties, application.yml and *.factories files, symbol search for request mappings and beans, and live data from running Spring Boot applications.

Using it inside Neovim (commands, live data, build lenses, conversion) is described in the help page, :help coc-springboot, available once the extension is activated. This README covers requirements, setup, configuration and troubleshooting.

Requirements

  • Neovim with coc.nvim 0.0.82 or later.
  • Java 21 or later to run the language server. With an older Java the server does not start.
  • A full JDK, not only a JRE, for live data from running applications. With a JRE the server still starts, but live data is unavailable and the extension warns when it loads.
  • The coc extension coc-java (or coc-java-dev). The Spring Boot server is started through it; without coc-java it does not start.
  • A Spring Boot project built with Maven or Gradle.

Installation

:CocInstall coc-java coc-springboot

The extension ships with the language server (in language-server/) and its coc-java bundles (in jars/). Some optional libraries of the upstream server are not included, for example for Kotlin.

The extension activates when you open a Java file, or when the workspace contains pom.xml, build.gradle, settings.gradle, their .kts variants or .classpath. The server starts once coc-java has loaded the project.

Setup

Java

The extension picks the Java that runs the server in this order and writes the choice to its SpringBoot output channel:

  1. the spring-boot.ls.java.home setting, when the directory exists,
  2. the jre/ directory of coc-java (or coc-java-dev),
  3. the java.home setting of coc-java, when the directory exists,
  4. a JDK found through JAVA_HOME or PATH.

If none of them gives a Java, the extension reports "Couldn't locate java in $JAVA_HOME or $PATH".

A custom server directory

To run another build of the server, point spring-boot.ls.directory to a directory with a language-server/ subdirectory:

{
    "spring-boot.ls.directory": "/home/user/springboot"
}

language-server/ holds either exactly one jar whose name contains language-server, or the exploded layout of older Spring Tools releases (BOOT-INF/classes and BOOT-INF/lib). Only the server is replaced: the bundles in jars/ always come from the extension, and you need no java.jdt.ls.bundles entry. When the directory does not exist, the bundled server runs (see Troubleshooting).

Preparing an application for live data

Live data comes from the actuator endpoints of a running application, read over JMX. Start the application with:

-Dspring.jmx.enabled=true
-Dmanagement.endpoints.jmx.exposure.include=*
-Dspring.application.admin.enabled=true

The last argument also exposes the server port, which the request mapping links use. Local applications appear in the springboot.app.connect picker only with:

{
    "boot-java.live-information.all-local-java-processes": true
}

Applications on other machines go into boot-java.remote-apps (see Live data).

Files

  • The SpringBoot output channel holds the messages of the extension and the server, the SpringBoot Build output channel the output of the Maven and Gradle builds. Open them with :CocCommand workspace.showOutput.
  • The server writes a log file only when spring-boot.ls.logfile is set.
  • The builds write the generated Spring Data AOT metadata into the project, under target/spring-aot/main/resources or build/generated/aotResources.

The extension stores nothing else.

Troubleshooting

  • The server does not start: check that coc-java is installed and that a Java file or a build file of the project is open, then read the SpringBoot output channel. It names the Java the extension found and why it failed. When the server cannot be launched at all, the extension shows "Unable to launch the spring boot language server: {reason}".
  • "Spring Tools Language Server requires Java 21 or higher to be launched. Current Java version is {version}": point spring-boot.ls.java.home to a Java 21 or later.
  • "The Java runtime used by Spring Tools ({path}) does not provide the {module} module. A full JDK is required to attach to locally running Spring Boot apps, hence live process information (live hovers and live metrics) is unavailable. All other features work as usual.": install a full JDK and point spring-boot.ls.java.home to it, or press "Stop Asking" to silence the warning.
  • "Couldn't locate java in $JAVA_HOME or $PATH": set spring-boot.ls.java.home (see Java).
  • The bundled server runs although spring-boot.ls.directory is set: the SpringBoot output channel shows "spring-boot.ls.directory" points to folder that does NOT exist: <path>; correct the path and run :CocRestart.
  • "Multiple server jars found in ...": keep one language-server*.jar in the language-server/ directory of the server directory.
  • "Classpath listener not supported while Java Language Server is in LightWeight mode": coc-java runs in its lightweight mode; the project features of the server need its standard mode.
  • Other language servers stop working on application.yml and the SpringBoot output channel shows "Dynamic registration middleware not supported by coc, forcing spring filetypes on configuration files": your coc.nvim is too old to let configuration files keep their filetype, so the extension sets the Spring filetypes on them about 10 seconds after the start. Update coc.nvim.
  • No local application in the springboot.app.connect picker: set boot-java.live-information.all-local-java-processes and start the application with the JMX arguments of Preparing an application for live data.
  • A change under spring-boot.ls or boot-java.ai has no effect: run :CocRestart.

Development

Install the dependencies with npm install, then:

npm run build       # build lib/index.js
npm run watch       # rebuild on change
npm run typecheck   # type check
make update         # replace the bundled server with the latest Spring Tools release (needs gh)

Set SPRING_LS_USE_SOCKET before coc.nvim starts to talk to the server over a local socket instead of stdio.

Extension API

The extension returns an object to other coc extensions with:

  • client: the language client of the server.
  • Events for live applications, each with a live process as payload: onDidLiveProcessConnect, onDidLiveProcessDisconnect, onDidLiveProcessUpdate, onDidLiveProcessGcPausesMetricsUpdate and onDidLiveProcessMemoryMetricsUpdate.
  • Functions for live data: getLiveProcessData, refreshLiveProcessData, getLiveProcessMetricsData, refreshLiveProcessMetricsData and listConnectedProcesses.
  • getSpringIndex(): returns beans({projectName}), a promise of the beans of that project (name, type, location, injection points and supertypes), and onSpringIndexUpdated, an event fired when the server's Spring index changes; its payload has affectedProjects, the names of the updated projects, when the server reports them.

A live data query is an object with processKey and an endpoint: one of mappings, contextPath, port, properties and profiles, beans (with beanName and dependingOn as optional filters), or metrics (with metricName and optional tags).

Contributing

Issues and pull requests are welcome at https://github.com/asmodeus812/coc-springboot. Run npm run typecheck and npm run build before you send a change.

License

GNU General Public License, version 3 only (GPL-3.0-only); the full text is in LICENSE.

Read the complete README
  • Coc spring boot language server extension client
Activation Events
  • onLanguage:java
  • workspaceContains:pom.xml
  • workspaceContains:*/pom.xml
  • workspaceContains:build.gradle
  • workspaceContains:*/build.gradle
  • workspaceContains:settings.gradle
  • workspaceContains:*/settings.gradle
  • workspaceContains:build.gradle.kts
  • workspaceContains:*/build.gradle.kts
  • workspaceContains:settings.gradle.kts
  • workspaceContains:*/settings.gradle.kts
  • workspaceContains:.classpath
  • workspaceContains:*/.classpath
Developer Resources

Want to build, test, or contribute to coc.nvim extensions? Explore our official SDK and testing toolkits.

Open Developer Guide

Version History

This published npm package does not include a history.md or changelog.md file. Browse its npm versions or repository releases for available release information.