Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>velocityjsonNew to Visual Studio Code? Get it now.
velocityjson

velocityjson

Jeremy_324234

|
3 installs
| (0) | Free
Code for Velocity and JSON has highlighting
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

velocityjson

A Visual Studio Code extension for syntax highlighting of Velocity and JSON mixed code.

Features

This extension provides syntax highlighting for files that contain a mix of Velocity template language and JSON.

Key Features

  • JSON Syntax Highlighting: Properly highlights JSON structures including objects, arrays, strings, numbers, booleans, and null values
  • Velocity Syntax Highlighting: Highlights Velocity directives, variables, and comments
  • Mixed Code Support: Seamlessly handles Velocity code within JSON structures
    • Velocity variables inside JSON strings
    • Velocity directives within JSON values
    • Velocity code outside JSON structures
  • Comprehensive Directive Support: Recognizes all common Velocity directives:
    • Control structures: #if, #else, #elseif, #end
    • Loops: #foreach
    • Variable assignment: #set
    • Macros and includes: #macro, #parse
    • Flow control: #break

Installation

From VS Code Marketplace

  1. Open VS Code
  2. Press Ctrl+P (Windows/Linux) or Cmd+P (macOS)
  3. Type ext install velocityjson and press Enter
  4. Click Install

From Source

  1. Clone or download this repository
  2. Open the folder in VS Code
  3. Press F5 to run the extension in development mode
  4. Or package the extension using vsce package and install the .vsix file

Usage

  1. Open a file containing Velocity and JSON mixed code
  2. Ensure the file is recognized as "Velocity+JSON" language mode:
    • Click on the language mode indicator in the bottom right corner
    • Select "Velocity+JSON" from the dropdown menu
  3. The extension will automatically apply syntax highlighting

Supported File Extensions

The extension is configured to work with the following file extensions:

  • .vm (Velocity files)
  • .json (JSON files)

You can also manually set the language mode to "Velocity+JSON" for any file.

Extension Settings

This extension contributes the following settings:

  • velocity.highlightLevel: Controls the intensity of syntax highlighting (default: "full")
    • basic: Basic syntax highlighting
    • full: Full syntax highlighting with all features

Example

Here's an example of how the extension highlights mixed Velocity and JSON code:

#set($count = 0)
#foreach($p in $param)
    #if($p.sku)
        #set($count = $count + 1)
    #end
#end

{
  "name": "Product",
  "count": $count,
  "items": [
    #foreach($item in $items)
    {
      "id": "$item.id",
      "name": "$item.name"
    }#if($foreach.hasNext),#end
    #end
  ]
}

Known Issues

  • No known issues at this time. Please report any issues on the GitHub repository.

Release Notes

0.0.1

Initial release of velocityjson extension with:

  • Basic JSON syntax highlighting support
  • Velocity directive and variable highlighting
  • Mixed code support for Velocity within JSON structures
  • Support for common Velocity directives

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT


Enjoy!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft