Status: Active JetBrains Marketplace plugin. Issues are open for bugs and focused feature requests.
Local SonarQube quality snapshot (checked 2026-05-19)
| Metric | Value |
|---|---|
| Quality Gate | OK |
| Overall coverage | 84.1% |
| Bugs | 0 |
| Vulnerabilities | 0 |
| Code smells | 0 |
| Overall duplicated lines | 0.0% |
These values are a checked local SonarQube API snapshot, not live cloud badges.
Advanced Language Injection is a JetBrains plugin for projects that keep SQL or other DSL snippets inside structured configuration values such as YAML, JSON, or Properties files.
The plugin lets you define ordered rules that:
- choose any registered IDE language
- match by file name or file path
- match prefixes either at the start of a value or anywhere inside it
- inject one or several non-overlapping segments inside the matched value
- preview rule matches against the current editor file before relying on them
- Open project settings and search for
Advanced Language Injection, or useTools | Open Setup Guide. - Click
Addto create a neutral rule manually, orAdd SQL examplefor a ready SQL preset. - Start with a safe rule:
- Prefix:
sql: - Language:
SQL - File pattern:
*.yaml - Path pattern:
config/**/*.yaml - Match scope:
File name + path - Prefix target:
Value starts with prefix
- Prefix:
- Open a matching file and use
Preview current fileto confirm the rule matches the current editor file.
Example YAML value:
query: "sql:select * from users where active = true"For YAML block scalars, match the key/header line and inject into the block body:
snippet: |
SELECT * FROM users WHERE active = trueUse prefix snippet: | for this style. If your files use the .yml extension, set the file pattern to *.yml
or use *.y*ml to cover both .yaml and .yml.
- SQL embedded in YAML/JSON configuration
- Regex, GraphQL, or other IDE languages embedded in structured values
- Teams with path-based conventions such as
config/**/*.yamlorqueries/**/*.json
- Rules are ordered; the first matching rule wins.
File name onlyignoresPath pattern.File name + pathchecks both the full path and the project-relative path.Value starts with prefixis the safer mode for structured config values.Value contains prefixis kept for migrated legacy rules and broader matching scenarios.Inject every matched prefix segmentsplits multiple prefix hits into non-overlapping injected ranges.- YAML block scalar headers such as
snippet: |can be used as prefixes; the injected range starts inside the block body. - Rules that reference a language unavailable in the current IDE are shown as unavailable and skipped.
-
Clone this repository.
-
Build the plugin distribution archive.
Unix:
./gradlew buildPlugin --console=plain
Windows:
gradlew.bat buildPlugin --console=plain
-
Install the generated ZIP from
build/distributionsusingSettings | Plugins | gear icon | Install Plugin from Disk.
- Injection only works for PSI elements that support IntelliJ language injection hosts.
- Plain text files such as
*.txtare not supported. - Matching is value-oriented, not schema-aware. The plugin does not understand domain-specific YAML or JSON schemas.
- Rule preview validates matching against the current file and its value hosts; it does not execute inspections for the injected language.
- Built against IntelliJ IDEA 2022.3
- Declared compatibility starts at build
223.7571.182; no explicit upper build bound is set. - Local plugin verifier defaults to
IC-2022.3.3to keep the IDE cache small. - Before release, run the named release matrix with
-PpluginVerifierMatrix=release. It currently checksIC-2022.3.3,IC-2024.3.6,IU-2025.3, andIU-2026.1.2. - For one-off checks, override the matrix with
-PpluginVerifierIdeVersions=...orPLUGIN_VERIFIER_IDE_VERSIONS.
Unix:
./gradlew test buildPlugin verifyPlugin --console=plain
./gradlew runPluginVerifier --console=plain
./gradlew runPluginVerifier -PpluginVerifierMatrix=release --console=plainWindows:
gradlew.bat test buildPlugin verifyPlugin --console=plain
gradlew.bat runPluginVerifier --console=plain
gradlew.bat runPluginVerifier "-PpluginVerifierMatrix=release" --console=plain- GitHub Actions CI runs on every push to
mainand on pull requests viaci.yml. - CI runs
test,buildPlugin, andverifyPlugin, then uploads the built plugin ZIP as an artifact. - GitHub Releases are created from tags like
v1.1.1viarelease.yml. - Release builds also run
runPluginVerifierwith-PpluginVerifierMatrix=release, attach the ZIP andSHA256SUMS.txt, and optionally publish to JetBrains Marketplace if the required secrets are configured. CHANGELOG.mdis the single source of truth for release notes. The release workflow uses it for GitHub Releases, andpatchPluginXmluses the same version section for JetBrains Marketplace change notes.
PUBLISH_TOKEN_PLUGIN- JetBrains Marketplace permanent token (perm-...), not a GitHub token. Store the token exactly as Marketplace shows it; do not add aperm:prefix.
Plugin signing variables are optional and are only needed when running the signPlugin task explicitly:
CERTIFICATE_CHAINPRIVATE_KEYPRIVATE_KEY_PASSWORD
For local uploads on Windows, set the same Marketplace token with:
[Environment]::SetEnvironmentVariable("PUBLISH_TOKEN_PLUGIN", "perm-...", "User")Then run:
gradlew.bat buildPlugin --console=plain
gradlew.bat publishPlugin --console=plain- Runtime UI strings are localized through resource bundles.
- The plugin descriptor and marketplace-style metadata are intentionally English-only to avoid duplicated bilingual descriptions being shown at the same time.
This project is licensed for non-commercial use under the PolyForm Noncommercial License 1.0.0. Commercial use, resale, paid distribution, marketplace publication, SaaS hosting, or bundling into a paid product requires separate written permission from the author. Project names, logos, package identifiers, store listings, screenshots, and other branding assets are not licensed for use in forks or redistributed builds.