NPF Syntax Highlighting for Visual Studio Code
This extension provides rich color syntax highlighting and configuration for Network Performance Framework (.npf) files in VS Code.

Features
- Section Recognition: Full highlighting of NPF sections (e.g.
%info, %variables, %config, %script, %init, %exit, %pyexit, %file, %import). Supports tag-gated sections (e.g. tls:%script, %-nostat:import).
- Multi-language Embedding:
- Automatically embeds Shell Script (Bash) syntax inside
%script, %init, and %exit blocks.
- Automatically embeds Python syntax inside
%pyexit blocks.
- NPF Syntax Specials:
- Highlights NPF Math
$(( ... )) as Python code. Correctly ignores escaped bash arithmetic \$(( ... )).
- Highlights NPF variables (
$VAR, ${VAR}) and node attributes (e.g. ${server:0:ip}) within scripts, files, and math blocks.
- Jinja2 Support: Highlights Jinja expressions
{{ ... }} and blocks {% ... %} inside your scripts.
- Variables & Config Styling: Displays ranges
[1-8], sets {a,b,c}, and tag gates (nocongestion:CONGESTION=cubic) cleanly.
- Comments: Full support for
# and // comment syntax.
Installation
From Source (Local Development)
To use this extension locally, clone the npf repository and symlink the extension folder to your VS Code extensions folder:
ln -s "/path/to/npf/misc/vscode-npf" ~/.vscode/extensions/vscode-npf
(For Antigravity IDE users, symlink to ~/.antigravity-ide/extensions/vscode-npf instead).
Then reload your VS Code window (Cmd+Shift+P -> Developer: Reload Window).
Extension Settings
This extension contributes the npf language ID and associates it with all .npf files automatically.
License
This extension is released under the MIT License.
| |