Adds syntax highlighting and IntelliSense for @env-spec enabled .env files in IntelliJ IDEA and WebStorm.
Inspired by the VS Code / Open VSX extension:
-
Completion (IntelliSense) for:
- Decorators (
@required,@type=, etc.) @type=data types (string, number, enum, url, etc.)- Type options (e.g.
string(minLength=5)) - Resolver functions (
concat,fallback,forEnv, etc.) $KEYreferences- Enum values when
@type=enum(...)is used
- Decorators (
-
Inline diagnostics for:
- Duplicate single-use decorators
- Incompatible decorators (
@required+@optional, etc.) - Invalid enum values
- Static value validation (url prependHttps, string length, number range, etc.)
-
Documentation on hover for decorators
-
Syntax highlighting for .env and .env.* files:
- Comment lines (
# …) vs assignments (KEY=value, optionalexport) - Colors follow Settings → Editor → Color Scheme → Env Spec (defaults match line comments, keywords, keys,
=, and string-like values)
- Comment lines (
-
Project view icon for registered
.env/.env.*files -
Toggle line comment (
#) support -
Enter on a
#line inserts a new line with the same indent and#(block comment continuation)
- Open Settings | Plugins | Marketplace
- Search for "Env Spec" or "@env-spec"
- Install and restart the IDE
- Build the plugin:
./gradlew buildPlugin(or./gradlew build, which includes it) - The plugin ZIP is in
build/distributions/ - Install via Settings | Plugins | ⚙️ | Install Plugin from Disk...
.env.env.*(e.g..env.schema,.env.local,.env.example)
- IntelliJ IDEA 2024.3+ or WebStorm 2024.3+
- Java 17 (for building) — use a supported JDK for the Gradle version in this repo (see Troubleshooting if you see a cryptic
25error with Java 25)
# Build
./gradlew build
# Run IDE with plugin
./gradlew runIde
# Run tests
./gradlew testBuild fails with "What went wrong: 25" — You're using Java 25, which Gradle 8.x doesn't support. Use Java 17:
# Homebrew (openjdk@17)
export JAVA_HOME="/opt/homebrew/opt/openjdk@17"
./gradlew buildYou can add that export to your ~/.zshrc or run it before each build.
MIT