coc-spring-dashboard
asmodeus812Spring Boot dashboard for coc.nvim
Published Package Summary
coc-spring-dashboard
Spring Boot dashboard for coc.nvim: tree views of the Spring Boot apps of the workspace, their beans, endpoint mappings, properties and memory, and signs on bean definitions and request mappings in the code.
It is a port of microsoft/vscode-spring-boot-dashboard (MIT). See NOTICE and LICENSE.
Using it inside Neovim is described in the help page:
:help coc-spring-dashboard.
Requirements
-
coc-java and coc-springboot, installed and active (declared as extension dependencies). The dashboard gets all of its data through them and waits for their servers to start, the Java server until it has imported the projects; until then it says "Java server starting" or "Spring Boot server not running".
-
For live data (running state, live beans and mappings, properties, memory), a running app with
spring-boot-starter-actuatoron its classpath, started with these JVM arguments (the dashboard adds them to the apps it starts, from thevmArgsofspring.dashboard.launch.defaults):-Dspring.jmx.enabled=true -Dmanagement.endpoints.jmx.exposure.include=* -Dmanagement.endpoint.env.show-values=ALWAYS -
Apps started by the dashboard connect by their pid and need no setting. Other apps connect through Attach to a remote app (
spring-boot-dashboard.app.remote.attach), or through coc-springboot'sspringboot.app.connectpicker, which offers the apps on your machine only with this coc-springboot setting incoc-settings.json(see:help coc-springboot-local-apps):"boot-java.live-information.all-local-java-processes": true -
For Debug, Attach debugger and the debug half of Attach to a remote app, nvim-dap in Neovim or vimspector in Vim and Neovim. Run needs no debugger.
Run, Debug and Stop are done by the dashboard: it opens a launch panel (profiles, server port, logging, JVM options, program arguments and environment, remembered per app), starts the JVM in a tab per app, the dashboard of the app (Beans, Mappings, Properties and Memory over the terminal), and stops it with SIGTERM and then SIGKILL. The JMX arguments above are added for you for apps it starts.
Installation
:CocInstall coc-spring-dashboard
Or build a checkout and add its folder to the runtimepath with your plugin manager:
npm ci
npm run build
Troubleshooting
- Failed requests to the Spring language server are logged to the output
channel "Spring Dashboard":
:CocCommand workspace.showOutput Spring Dashboard. - Jumps from the views and nvim-dap stops open in the source window of the app: the window Run, Debug or Attach was started from, or the first file window of its tab; without one, or outside an app tab, in a float.
- No trees, or a warning that coc-springboot or coc-java is not active:
check
:CocList extensionsand open a Java file of the project. - An app stays
○ stoppedwhile it runs: check the actuator dependency, the JVM arguments above, then run:CocCommand spring-boot-dashboard.livedata.refresh. - Every message the dashboard shows is explained in
:help coc-spring-dashboard-messages.
Development
npm ci
npm run build
npm run typecheck
- Spring Boot dashboard for coc.nvim
- onLanguage:java
Want to build, test, or contribute to coc.nvim extensions? Explore our official SDK and testing toolkits.
Open Developer GuideVersion 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.
Contributed Commands
All contributes.commands entries from the published package manifest for coc-spring-dashboard@0.4.3.
| Command (:CocCommand) | Description |
|---|---|
| spring-boot-dashboard.refresh | Look for the local apps again |
| spring-boot-dashboard.app.local.run | Run a local app |
| spring-boot-dashboard.app.local.runWithProfile | Run a local app with profiles |
| spring-boot-dashboard.app.local.debug | Debug a local app |
| spring-boot-dashboard.app.local.debugWithProfile | Debug a local app with profiles |
| spring-boot-dashboard.app.local.settings | Edit how a local app starts |
| spring-boot-dashboard.app.local.dashboard | Show the dashboard tab of a local app |
| spring-boot-dashboard.app.local.attach | Attach the debugger to a local app started with Run |
| spring-boot-dashboard.app.local.stop | Stop a local app |
| spring-boot-dashboard.app.local.open | Open a local app in the browser |
| spring-boot-dashboard.livedata.refresh | Reload the live data of the connected apps |
| spring-boot-dashboard.list | List the Spring Boot apps of the workspace |
| spring.dashboard.bean.navigate | Go to the bean |
| spring.dashboard.bean.open | Open the bean |
| spring.dashboard.bean.showAll | Show all beans |
| spring.dashboard.bean.showDefined | Show only the beans defined in the workspace |
| spring.dashboard.bean.showDependencies | Show the dependencies of the bean |
| spring.dashboard.bean.showInjectedInto | Show where the bean is injected |
| spring.dashboard.bean.showHierarchy | Show the hierarchy of the bean |
| spring.beans.find | Find a bean |
| spring.staticData.refresh | Refresh the beans and mappings of the workspace |
| spring.dashboard.endpoint.navigate | Go to the endpoint |
| spring.dashboard.endpoint.open | Open the endpoint in the browser |
| spring.dashboard.mapping.showAll | Show all mappings |
| spring.dashboard.mapping.showDefined | Show only the mappings defined in the workspace |
| spring.mappings.find | Find a mapping |
| spring.properties.find | Find a property |
| spring-boot-dashboard.app.remote.attach | Attach to a remote app: live data and debugger |
| spring-boot-dashboard.app.remote.connect | Connect the live data of a boot-java.remote-apps entry |
| spring-boot-dashboard.app.remote.disconnect | Disconnect the live data of a remote app |
Configuration Schema
All contributes.configuration entries from the published package manifest, including each raw property schema for coc-settings.json.
Raw JSON Schema
{
"type": "string",
"default": "{protocol}://{hostname}:{port}{contextPath}",
"description": "Url template of an app, {protocol} {hostname} {port} {contextPath}"
}Raw JSON Schema
{
"enum": [
"on",
"off"
],
"type": "string",
"default": "on",
"description": "Signs on the bean definitions and request mappings"
}Raw JSON Schema
{
"enum": [
"first",
"always",
"never"
],
"type": "string",
"default": "always",
"description": "When the launch panel opens: the first time per app (then the remembered settings are used), every time (default), or never"
}Raw JSON Schema
{
"enum": [
"always",
"keep"
],
"type": "string",
"default": "always",
"description": "When an app stops: close its dashboard tab (always), or keep the tab for the next run (keep)"
}Raw JSON Schema
{
"type": "object",
"default": {
"host": "localhost",
"jmxPort": "9010",
"debugPort": "5005",
"jmxVmArgs": [
"-Dcom.sun.management.jmxremote.port=${jmxPort}",
"-Dcom.sun.management.jmxremote.rmi.port=${jmxPort}",
"-Djava.rmi.server.hostname=${host}",
"-Dcom.sun.management.jmxremote.authenticate=false",
"-Dcom.sun.management.jmxremote.ssl=false",
"-Dspring.jmx.enabled=true",
"-Dspring.application.admin.enabled=true",
"-Dmanagement.endpoints.jmx.exposure.include=*",
"-Dmanagement.endpoint.env.show-values=ALWAYS"
],
"debugVmArgs": [
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:${debugPort}"
]
},
"properties": {
"host": {
"type": "string"
},
"jmxPort": {
"type": "string"
},
"debugPort": {
"type": "string"
},
"jmxVmArgs": {
"type": "array",
"items": {
"type": "string"
}
},
"debugVmArgs": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "The attach settings under every project's own: host, JMX port of the live data and JDWP port of the debugger (an empty port skips that half), and the JVM options Copy app startup options gives for each half, with ${host}, ${jmxPort} and ${debugPort} filled in"
}Raw JSON Schema
{
"type": "object",
"default": {},
"description": "Attach settings per project name, on top of spring.dashboard.attach.defaults: a key that is set replaces the default. The host and ports are used until an attach to the project remembers others, the JVM options always come from the settings (here or spring.dashboard.attach.defaults). { \"orders-service\": { \"host\": \"10.0.0.5\", \"debugPort\": \"\" } }",
"additionalProperties": {
"type": "object",
"properties": {
"host": {
"type": "string"
},
"jmxPort": {
"type": "string"
},
"debugPort": {
"type": "string"
},
"jmxVmArgs": {
"type": "array",
"items": {
"type": "string"
}
},
"debugVmArgs": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}Raw JSON Schema
{
"type": "object",
"default": {
"port": "",
"vmArgs": [
"-Dcom.sun.management.jmxremote.authenticate=false",
"-Dcom.sun.management.jmxremote.ssl=false",
"-Dspring.jmx.enabled=true",
"-Dspring.application.admin.enabled=true",
"-Dmanagement.endpoints.jmx.exposure.include=*",
"-Dmanagement.endpoint.env.show-values=ALWAYS"
],
"envVars": {},
"logLevel": "",
"profiles": [],
"debugReport": false,
"logPackages": "",
"programArgs": []
},
"properties": {
"port": {
"type": "string"
},
"vmArgs": {
"type": "array",
"items": {
"type": "string"
}
},
"envVars": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"logLevel": {
"type": "string"
},
"profiles": {
"type": "array",
"items": {
"type": "string"
}
},
"debugReport": {
"type": "boolean"
},
"logPackages": {
"type": "string"
},
"programArgs": {
"type": "array",
"items": {
"type": "string"
}
}
},
"description": "The launch settings under every app's own: profiles, server port (empty: the app's own, 0: random), root log level, per package log levels (com.example=DEBUG), debug report, JVM options, program arguments, environment. The default JVM options feed the live data, show-values=ALWAYS lets Spring Boot 3 report property values instead of ******. The JMX port, host and project name are added per run"
}Raw JSON Schema
{
"type": "object",
"default": {},
"description": "Launch settings per app name, used until the launch panel remembers others, on top of spring.dashboard.launch.defaults: JVM options are appended without exact duplicates, program arguments (programArgs) replace a default with the same option name, profiles are added, the environment variables (envVars) are merged per key, a single value replaces the default. { \"my-app\": { \"profiles\": [\"dev\"], \"port\": \"0\", \"vmArgs\": [\"-Xmx512m\"] } }",
"additionalProperties": {
"type": "object",
"properties": {
"port": {
"type": "string"
},
"vmArgs": {
"type": "array",
"items": {
"type": "string"
}
},
"envVars": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"logLevel": {
"type": "string"
},
"profiles": {
"type": "array",
"items": {
"type": "string"
}
},
"debugReport": {
"type": "boolean"
},
"logPackages": {
"type": "string"
},
"programArgs": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}Raw JSON Schema
{
"type": "number",
"default": 10,
"description": "Seconds an app gets to shut down after Stop (SIGTERM) before it is killed (SIGKILL)"
}Raw JSON Schema
{
"type": "array",
"items": {
"enum": [
"beans",
"endpoints",
"properties",
"memory",
"terminal"
],
"type": "string"
},
"default": [
"beans",
"endpoints",
"properties",
"memory",
"terminal"
],
"description": "The panes of an app dashboard tab, in their fixed places: the views side by side on top, the terminal below. A left out view is not shown anywhere, a left out terminal keeps running without a window. An empty list is all of them",
"uniqueItems": true
}Raw JSON Schema
{
"type": "number",
"default": 30,
"description": "Seconds to wait for the debugger to attach (Debug, Attach debugger, Attach to a remote app); an app started with Debug is stopped after that, the others keep running"
}Raw JSON Schema
{
"type": "number",
"default": 75,
"maximum": 100,
"minimum": 20,
"description": "Width and height, in percent of the screen, of the float a bean, an endpoint, a relation or an nvim-dap stop opens in when the app has no source window, or there is no app"
}Raw JSON Schema
{
"type": "number",
"default": 65,
"maximum": 90,
"minimum": 10,
"description": "Percent of the height of an app dashboard tab given to the terminal under the views"
}Raw JSON Schema
{
"type": "number",
"default": 10,
"description": "Width of the memory sparklines"
}Raw JSON Schema
{
"type": "number",
"default": 5000,
"description": "Interval of the memory metrics poll"
}