Syntax highlighting for ENDF and ENDF-6 evaluated nuclear data files in VS Code.
This extension helps inspect fixed-width ENDF records by contributing a language id, a TextMate grammar, and a small runtime hover provider. It is intentionally lightweight: there is no parser, diagnostics engine, language server, or network dependency.
VS Code recognizes these extensions as ENDF by default:
.endf.endf6.pendf.gendf.tape
It also recognizes ENDF-like .dat files through ENDF-specific filename
patterns such as *endf*.dat, *pendf*.dat, and *gendf*.dat. Generic .dat
files are not claimed by extension alone; files with no specific extension can
still be detected when the first line has an ENDF-like fixed-column tail.
ENDF records are fixed-width cards. The grammar treats each line as:
- columns 1-66: payload fields
- columns 67-70:
MAT - columns 71-72:
MF - columns 73-75:
MT - columns 76-80: optional sequence number (
NS)
Both 75-column records, where the sequence number is omitted, and standard 80-column records are supported.
The grammar highlights:
- fixed-width numeric payload fields, including ENDF implicit-exponent values
such as
3.007000+3 - integer control fields
MAT,MF,MT, and optionalNStail columnsSEND,FEND,MEND, andTENDstructural end recordsMF ...,MT ...,MF=..., andMT=...references in descriptive text
When the cursor, selection, or hover is on a recognized ENDF number, the extension explains the fixed-column meaning. Selection and cursor movement update the status bar; hover shows the fuller explanation.
- payload fields in columns 1-66 are identified as
C1,C2,L1,L2,N1, orN2, with parsed ENDF implicit-exponent values - tail fields in columns 67-80 are identified as
MAT,MF,MT, andNS - common
MFandMTnumbers are expanded to their ENDF-6 descriptions - textual references such as
MF=3,MF3,MF 12,MT=102,MT1, andMT=52-82are also explained
Payload field meanings are often record-specific, so the hover reports the
reliable fixed-field role unless a standard MF/MT code description applies.
Open this folder in VS Code and press F5, or run Run Extension from the
Run and Debug view. In the Extension Development Host, open a local ENDF test
file; VS Code should select the ENDF language mode automatically for supported
extensions and ENDF-like fixed-column first lines.
Useful sample checks:
- line 2: ENDF numeric
HEAD-style fields andMAT/MF/MTtail - lines 18-19: descriptive
MF 12/MT 102text - lines 456-457:
SENDandFEND - lines 5505-5506:
MENDandTEND
Use Developer: Inspect Editor Tokens and Scopes in VS Code to inspect the actual TextMate scopes assigned to a token.
Clone the repository and package the extension locally:
npx @vscode/vsce package --no-dependencies
code --install-extension endf-syntax-0.0.1.vsixLocal sample ENDF files used for development checks are ignored by git and are not included in the packaged extension.
The extension entry point is extension.js, the language contribution is
declared in package.json, and the TextMate grammar is in
syntaxes/endf.tmLanguage.json.
To test changes, open the repository in VS Code and use the provided
.vscode/launch.json configuration. Reload the Extension Development Host
after grammar or runtime edits.
Please report bugs and syntax highlighting gaps at https://github.com/tokamaster/vscode_endf/issues.
This project is released under the MIT License. See LICENSE for details.