Gradle DSL Assistant

Gradle DSL Assistant adds context-aware completions, rich hover documentation, definition navigation, and live Maven Central dependency search to Groovy and Kotlin Gradle build scripts (build.gradle and build.gradle.kts).
It complements rather than replaces Gradle for Java and existing language extensions by focusing specifically on project-aware DSL completion, version catalogs, and dependency intelligence without running a heavyweight Language Server.
Repository: github.com/Houssam-OUATMANI/gradle-dsl-assistant
Features
1. Dialect-Aware DSL Completions (Groovy & Kotlin DSL)
- Groovy DSL (
build.gradle): Idiomatic single-quoted strings, unparenthesized dependency calls (implementation '...'), plugin ID declarations (id '...'), and dynamic task registrations.
- Kotlin DSL (
build.gradle.kts): Strict double-quoted strings ("..."), parenthesized function calls (implementation("...")), specialized Kotlin plugin helpers (kotlin("jvm"), kotlin("android"), kotlin("kapt"), kotlin("multiplatform")), and typed task registrations.
- Context-aware completions for all standard Gradle blocks:
plugins, repositories, dependencies, configurations, tasks, java, application, sourceSets, publishing, testing, toolchain, signing, and wrapper.
- Project-specific task names, dependency configurations, applied extension names, and task types discovered directly from the evaluated Gradle project model.
2. Maven Central Dependency & Version Intelligence
- Instant suggestions right after
implementation '': As soon as quotes are opened, popular standard dependencies (Spring Boot, Guava, Jackson, SLF4J, Lombok, JUnit, Coroutines, etc.) and project-declared libraries are offered immediately.
- Live keyword search: Type library names directly inside quotes (e.g.
implementation 'spring' or implementation("guava")) to query Maven Central artifacts dynamically.
- Version autocompletion: Type a second colon (e.g.
implementation 'org.slf4j:slf4j-api:' or implementation("com.google.guava:guava:")) to fetch and autocomplete available versions directly from Maven Central.
- Background asynchronous search with non-blocking caching and debounce.
3. Rich Hover Documentation (IntelliSense)
- Gradle DSL documentation: Hover over blocks (
plugins, dependencies, repositories, tasks, java, toolchain) and methods (implementation, api, runtimeOnly, testImplementation) to see formatted signatures in both Groovy and Kotlin DSL, explanations, and direct links to the official Gradle User Manual.
- Project Tasks: Hover over task names to view their runtime type, class inheritance chain (e.g.
Jar → AbstractArchiveTask → DefaultTask), and owning project path.
- Version Catalogs: Hover over catalog accessors (
libs.spring.boot.starter) to inspect the catalog name, alias, and the exact TOML declaration.
4. Definition Navigation ("Go to Definition")
- Version Catalog navigation: Press
F12 or Ctrl+Click on any version catalog accessor (e.g. libs.spring.boot.starter or libs.plugins.kotlin.jvm) to open gradle/libs.versions.toml directly at the exact line of declaration.
- Subproject navigation: Press
F12 on project(':subproject') to jump straight to the subproject's build.gradle or build.gradle.kts.
Requirements and Safety
The project model is refreshed safely using help with an init-script through the Gradle Wrapper (or Gradle on PATH). Because Gradle evaluates build scripts during configuration, model discovery runs only in trusted workspaces. Disable gradleDslAssistant.autoSync to opt out.
Development
npm install
npm test
npm run package
The packaged VS Code extension is written to gradle-dsl-assistant-0.3.0.vsix.
| |