VS Code LS-DYNA extension

Integrates LS-DYNA into VS Code.
This extension integrates LS-DYNA formatting, keyword snippets, and language tooling into VS Code.
Example

Features
Syntax & Navigation
- Syntax highlighting for
.k, .key, and .dyna files
- Keyword folding — each
*KEYWORD block 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
*INCLUDE filenames 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
¶meter names (Ctrl/Cmd+Click)
- Rename parameter across the file (F2)
- Inlay hints show the resolved value of each
¶meter reference inline
- "N references" CodeLens above each parameter definition — click to open the References panel
- Bare variable names in
*PARAMETER_EXPRESSION values are highlighted the same color as ¶m references
Sidebar Panel
- Include Tree — recursively scans all
*INCLUDE files 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
.cfile command files
Settings
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"
}
Keyword Data
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.py
This overwrites snippets/lsdyna.json and keywords/field_data.json.
Contributing new Keywords
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.py from the repo root to regenerate snippets/lsdyna.json from the full pydyna keyword database (3168 keywords).
- Create a new pull request to merge your branch into master.
Contributors
Some References
vim-lsdyna
DCHartlen's vscode extension