Integrates LS-DYNA into VS Code.
This extension integrates LS-DYNA formatting, keyword snippets, and language tooling into VS Code.
Syntax & Navigation
- Syntax highlighting for
.k,.key, and.dynafiles - Keyword folding — each
*KEYWORDblock collapses independently - Jump to next/previous keyword:
Ctrl+Alt+Down/Ctrl+Alt+Up - Select the current keyword block via the right-click context menu
- Word wrap off by default for fixed-width column alignment
Include Files
*INCLUDEfilenames are highlighted green (resolved) or red (missing)- Right-click an include filename → Open *INCLUDE File, or Ctrl/Cmd+Click
- Resolves
*INCLUDE_PATH,*INCLUDE_PATH_RELATIVE, and../style relative paths
Parameters
- Go to Definition and Find All References for
¶meternames (Ctrl/Cmd+Click) - Rename parameter across the file (F2)
- Inlay hints show the resolved value of each
¶meterreference inline - "N references" CodeLens above each parameter definition — click to open the References panel
- Bare variable names in
*PARAMETER_EXPRESSIONvalues are highlighted the same color as¶mreferences
Sidebar Panel
- Include Tree — recursively scans all
*INCLUDEfiles and displays them as a tree; click any entry to open the file - Keyword Index — shows all keywords used in the current file (local mode) or the full include tree (recursive mode); toggle between modes with the toolbar buttons

Diagnostics
- Lines exceeding 80 characters (excluding comments) are flagged as warnings
Snippets
- Tab-completable snippets for common LS-DYNA keywords
LS-PrePost
- Syntax highlighting for
.cfilecommand files
The extension respects standard VS Code settings. Some useful ones for LS-DYNA files:
| Setting | Default | Description |
|---|---|---|
editor.hover.enabled |
true |
Show keyword and field hover tooltips |
editor.inlayHints.enabled |
on |
Show resolved parameter values inline |
editor.codeLens |
true |
Show "N references" above parameter definitions |
editor.wordWrap |
off |
Word wrap (off by default for fixed-width columns) |
These can be scoped to LS-DYNA files only by adding them under "[lsdyna]" in your settings.json:
"[lsdyna]": {
"editor.hover.enabled": false,
"editor.inlayHints.enabled": "off"
}Snippets and hover documentation are generated from the pydyna keyword database (kwd.json), which is maintained by Ansys and covers 3168 LS-DYNA keywords with full field definitions, types, defaults, and help text. This data is used at build time only — it is not bundled in the extension.
To regenerate after updating pydyna:
# Clone pydyna as a sibling of this repo (one-time setup)
git clone https://github.com/ansys/pydyna ../pydyna
# Regenerate snippets and hover field data
python keywords/generate_from_pydyna.pyThis overwrites snippets/lsdyna.json and keywords/field_data.json.
There are a few ways you can go about adding keywords or features:
- Send me an email or message on Github with the desired keyword (and an example).
- Make a pull request:
- Create a fork of the master.
- Clone pydyna as a sibling directory (
../pydyna). - Run
python keywords/generate_from_pydyna.pyfrom the repo root to regeneratesnippets/lsdyna.jsonfrom the full pydyna keyword database (3168 keywords). - Create a new pull request to merge your branch into master.
