Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Lumerical Script LanguageNew to Visual Studio Code? Get it now.
Lumerical Script Language

Lumerical Script Language

ErwenL

|
8 installs
| (0) | Free
Syntax highlighting for lumerical script language
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Lumerical Script Language Support for VS Code

Version VS Code Version License

A Visual Studio Code extension that provides syntax highlighting, code snippets, and language support for Lumerical Script Language (.lsf files).

Features

📝 Syntax Highlighting

  • Full syntax highlighting for Lumerical Script Language (MATLAB-like syntax)
  • Support for all Lumerical built-in commands (765+ commands)
  • Color coding for:
    • Keywords: if, else, elseif, for, while, switch, case, otherwise, try, catch, break, continue, return, end, function
    • Data types: double, single, int8-64, uint8-64, logical, char, string, struct, cell, table
    • Constants: pi, eps0, inf, NaN, true, false, i, j, realmax, realmin
    • Operators: arithmetic, logical, relational, transpose, field access, line continuation
    • Strings: single and double quoted with escape sequences
    • Numbers: integers, floats, scientific notation
    • Comments: line comments with #

💡 Intelligent Code Snippets

  • 765+ Lumerical commands with auto-completion
  • Snippets automatically insert command with parentheses: command($1)
  • Quick access to common Lumerical functions and operations

🔧 Language Features

  • Bracket matching and auto-closing
  • Comment toggling with #
  • Code folding for blocks
  • Syntax-aware highlighting

Installation

From VS Code Marketplace

  1. Open VS Code
  2. Go to Extensions view (Ctrl+Shift+X)
  3. Search for "Lumerical Script Language"
  4. Click Install

Manual Installation

  1. Download the .vsix package from Releases
  2. Open VS Code
  3. Go to Extensions view (Ctrl+Shift+X)
  4. Click "..." menu and select "Install from VSIX..."
  5. Select the downloaded file

From Source

git clone https://github.com/ErwenL/lumerical-script-language.git
cd lumerical-script-language
npm install
npm run compile

Then press F5 to open a new VS Code window with the extension loaded.

Usage

Creating Lumerical Script Files

  1. Create a new file with .lsf extension
  2. VS Code will automatically recognize it as Lumerical Script
  3. Start typing Lumerical commands - syntax highlighting will activate immediately

Using Code Snippets

  1. Type the prefix of a Lumerical command (e.g., add2d)
  2. Press Ctrl+Space to trigger IntelliSense
  3. Select the desired command from the list
  4. Press Tab to navigate through snippet placeholders

Example Script

# Sample Lumerical script
x = 5;
y = 3.14;
z = 1i + 2j;

# Constants and operators
a = pi;
sum = x + y;
transpose_matrix = matrix';

# Control flow
if x > 0
    disp('positive');
else
    disp('non-positive');
end

# Lumerical specific commands
add2drect;
selectall;

Syntax Support Details

Supported Language Elements

  • Control Structures: if, else, elseif, for, while, switch, case, otherwise, try, catch
  • Functions: function definitions and calls
  • Operators:
    • Arithmetic: +, -, *, /, ^, .*, ./, .\, .^
    • Logical: &, &&, |, ||, ~, ==, ~=, ~==
    • Relational: >, >=, <, <=
    • Transpose: ', .'
    • Field access: . (for property access)
    • Line continuation: ...
  • Data Types: All MATLAB-compatible numeric and container types
  • Literals: Matrix [], cell {}, string "" and ''
  • Comments: Single line with #

File Association

  • Primary extension: .lsf
  • Language ID: lumscript
  • Language name: "Lumerical Script"

Configuration

The extension works out of the box with no configuration required. However, you can customize the following in your VS Code settings:

{
  "[lumscript]": {
    "editor.tabSize": 4,
    "editor.insertSpaces": true,
    "editor.formatOnSave": false
  }
}

Known Issues

  • Limited semantic analysis (syntax highlighting only)
  • No parameter hints for Lumerical command arguments
  • No integrated documentation lookup

These limitations are due to the lack of public Lumerical Script Language specification. Contributions to improve these areas are welcome!

Development

Project Structure

lumerical-script-language/
├── syntaxes/
│   └── lumscript.tmLanguage.json     # TextMate grammar for syntax highlighting
├── language-configuration.json       # Language configuration
├── snippets.json                     # Code snippets (765+ commands)
├── references/
│   ├── lumscript_command.csv         # Command database
│   ├── matlab.json                   # MATLAB grammar reference
│   └── python_example.json           # Python grammar reference
├── package.json                      # Extension manifest
└── sample.lsf                        # Example script

Building from Source

  1. Clone the repository
  2. Install dependencies: npm install
  3. Open in VS Code: code .
  4. Press F5 to start debugging

Testing

  1. Open the sample.lsf file in the project
  2. Verify syntax highlighting appears correctly
  3. Test code snippets by typing command prefixes

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

Areas for contribution:

  • Improve grammar coverage
  • Add more code snippets with parameters
  • Implement Language Server Protocol (LSP) features
  • Add integrated documentation

Release Notes

0.0.1

  • Initial release
  • Basic syntax highlighting for Lumerical Script Language
  • 765+ code snippets for Lumerical commands
  • Language configuration for .lsf files
  • Support for MATLAB-like syntax elements

License

This extension is licensed under the MIT License.

Acknowledgments

  • Based on MATLAB and Python TextMate grammars
  • Command list sourced from Lumerical documentation
  • Inspired by the need for better Lumerical script editing tools

Support

  • Issues: Report bugs or request features on GitHub Issues
  • Questions: Use GitHub Discussions for questions and discussions

Enjoy better Lumerical script editing with VS Code! 🚀

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