Gradle Language Server by Bitno
A lightweight, private and secure Gradle language server for VS Code.
Early development: this extension is still being built. Expect missing features, rough edges and breaking changes between versions.
Lightweight, private and secure by design
Built by a developer, for developers.
- Lightweight: syntax errors, the outline and Gradle's API work from the script's parser and your wrapper's Gradle distribution, without running Gradle. Gradle loads a build in the background only once you open one of its scripts, and again when one of its build files changes.
- Private: no telemetry, no account. When you open one of a build's scripts, Gradle loads the build as
./gradlew would, without asking: it downloads your wrapper's distribution if it isn't there yet, fetches your build's plugins and their sources, and Groovy's sources if your build has a Groovy script, and resolves your dependencies' versions (their POMs and BOMs, never their jars), from the repositories your build declares. If your wrapper's distribution has no sources (-bin), the server also downloads Gradle's sources the first time they're needed, once per Gradle version, from the server your wrapper's distributionUrl names. Nothing else is contacted.
- Secure: error messages never show an exception's text or Gradle's output; the details go to the server's log. Gradle's sources are kept only when they match Gradle's published SHA-256. Loading a build runs its scripts as
./gradlew would, but no tasks, so open builds you trust.
Supported
- Groovy DSL:
build.gradle, settings.gradle, init.gradle and other *.gradle scripts
- Kotlin DSL:
build.gradle.kts, settings.gradle.kts and other *.gradle.kts scripts
- Gradle: 9.0 or newer, the version the build's wrapper names
Features
- Syntax errors as you type, from Groovy's and Kotlin's own parsers
- Completion of the blocks, properties and methods a script can use where you type, for the build's own Gradle version
- What the build's plugins add: extensions such as
java {} and kotlin {}, configurations such as implementation(...), tasks and ext properties
- Version catalogs:
libs. accessors complete, also in plugins { alias(...) }, and hover shows an entry's coordinates and version
libs.versions.toml: tables, entries' keys, version.ref versions and bundles' libraries complete, and hover shows how scripts read an entry and what it loads
- Plugin ids in
plugins { id("…") }: Gradle's core plugins and those on the script's classpath
- Hover with the member's signature, what a block configures and links to Gradle's Javadoc
- Javadoc in hover and completion, from Gradle's sources and plugins' sources
- Go to definition in Gradle's sources and in plugins' sources, both downloaded in the background the first time they're needed
- Outline and folding of a script's blocks
gradle.properties and gradle-wrapper.properties: Gradle's keys and their values complete, and hover describes them
- A status bar icon that spins while the server loads a build or downloads sources, with a notification when that takes longer than 10 seconds, and what it's doing, what failed, its state and its Java when you hover it
- Syntax highlighting for Kotlin DSL scripts, which VS Code doesn't color on its own
- Gradle's names colored by what they are, in both DSLs: blocks, properties, methods, configurations and tasks
Coming soon
- Warnings for unknown blocks and properties
Requirements
- VS Code 1.145 or later.
- A Gradle build with a wrapper whose distribution has been downloaded, which happens the first time you run
./gradlew.
- Eclipse Temurin 27 in
~/.jdks, which the Java Language Server by Bitno downloads there, or JAVA_HOME set to a Java 27 JDK. The server runs on it; your build can use any Java version Gradle supports.
Getting started
Open a folder with a Gradle build and open one of its scripts. Syntax errors and Gradle's API work at once; what the build's plugins add appears once Gradle has configured the build in the background, and again after you save a script.
| |