Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Razor syntax and formattingNew to Visual Studio Code? Get it now.
Razor syntax and formatting

Razor syntax and formatting

Kevin Mogridge

|
1 install
| (0) | Free
Language support for razor scripting with syntax highlighting and formatting
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

razor Script Extension for VS Code

A Visual Studio Code extension that provides language support for razor scripting with syntax highlighting and code formatting for the Outlands server.

Features

  • Syntax Highlighting: Full syntax highlighting for razor script files

    • Commands (action, agent, gump, message, target, timer, etc.)
    • Control flow statements (if/endif, for/endfor, while/endwhile)
    • Keywords (and, or, not, as, in, break, continue, loop, stop)
    • Expressions (player attributes, timers, lists, misc functions)
    • Comments (// and # style)
    • Variables and pre-defined aliases
    • String literals and numeric values
  • Code Formatting: Automatic indentation for razor scripts

    • Smart indentation for control structures
    • Preserves comments and empty lines
    • Format on save support
  • Language Features:

    • Auto-closing pairs for quotes and brackets
    • Code folding for control structures
    • Comment toggling

File Extensions

The extension recognizes the following file extensions:

  • .razor
  • .uos

Usage

  1. Install the extension in VS Code
  2. Open or create a razor script file (.razor or .uos)
  3. The syntax highlighting will be applied automatically
  4. Use Shift+Alt+F (Windows/Linux) or Shift+Option+F (Mac) to format your code
  5. Or right-click and select "Format Document"

Example Script

// Health check and healing script
if hp < 50
    cast 'greater heal'
    waitfortarget
    target 'self'
elseif poisoned
    potion 'cure'
endif

// Loop through meditation
while mana < maxmana
    skill 'meditation'
    wait 11000
endwhile

razor Scripting Guide

For comprehensive documentation on razor scripting, visit:

  • razor Scripting Guide
  • Commands Reference
  • Expressions
  • Keywords
  • Variables

License

This extension is provided as-is for use with razor scripting.

About razor

razor is an assistant application for Ultima Online that includes a powerful scripting engine. This extension makes it easier to write, edit, and maintain razor scripts in Visual Studio Code.

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