Live Template variable substitution fails silently in HTML files
0 reputation · 18 May 2021, 14:28 UTC
The goal is to achieve predictable variable expansion when inserting a Live Template that references project‑level properties or environment variables across different file types.
In WebStorm, Live Template variables can be defined to pull values from the project, environment, or other files, but the resolution behavior changes depending on the language mode of the target file. When the same template is used in an HTML file versus a JavaScript file, some variables may not be replaced and the insertion proceeds without any indication of failure, making it difficult to spot missing substitutions.
Because the IDE does not offer a preview of the expanded snippet before insertion, developers rely on trial‑and‑error to verify correctness, which hampers repeatable environment setup.
What controls whether a variable referencing an environment variable is resolved in a given file type?
Is there a way to enable verbose logging or diagnostics for Live Template variable expansion to see why a substitution is skipped?
Can the template be configured to emit a placeholder or warning instead of failing silently when a variable cannot be resolved?