npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

lantern-language-support

v0.2.0

Published

Syntax highlighting and language support for Lantern (.ltn) files

Downloads

5

Readme

Lantern Language Support for VSCode

This extension provides comprehensive language support for Lantern (.ltn) files in Visual Studio Code, including syntax highlighting, code completion, and various productivity features.

Features

🎨 Syntax Highlighting

  • Complete syntax support for all Lantern constructs:

    • Modules, Components, Interfaces, Events, Handlers
    • State machines with transitions
    • Constraints and business rules
    • Feature definitions (Gherkin-style)
    • Properties with type annotations
    • Import statements with module paths
  • Specialized highlighting for:

    • Comments and documentation comments
    • Data tables and doc strings
    • Step parameters in scenarios (<parameter>)
    • Type definitions and built-in types
    • Arithmetic operators (+, -, *, /)
    • Dependency declarations (Depends:)
    • Use statements with module paths (use module::component)

🎯 Code Completion

  • Smart snippets for all major constructs
  • Auto-completion for keywords and built-in types
  • Context-aware suggestions based on current scope

🔧 Editor Features

  • Bracket matching and auto-closing for {}, [], (), and quotes
  • Code folding for modules, components, and feature definitions
  • Smart indentation based on Lantern syntax rules
  • Comment toggling with # for line comments

🎨 Color Themes

  • Lantern Dark - Optimized dark theme with distinct colors for each construct type
  • Lantern Light - Clean light theme with professional color scheme

📝 Code Snippets

Available snippets (type the prefix and press Tab):

| Prefix | Description | |--------|-------------| | module | Complete module definition with properties and dependencies | | component | Component definition with properties | | interface | Interface with method signatures | | event | Event definition with data fields | | handler | Event handler with Given/When/Then steps | | state | State machine with transitions | | constraint | Constraint definition with rules | | feature | Feature definition with scenarios | | scenario | Individual scenario with steps | | outline | Scenario outline with examples table | | template | Scenario template with examples table | | depends | Dependencies section | | property | Typed property definition | | method | Method signature | | use | Import/use statement | | table | Data table | | docjson | JSON doc string | | generate | Code generation annotation |

Installation

From VSCode Marketplace

  1. Open VSCode
  2. Go to Extensions (Ctrl+Shift+X)
  3. Search for "Lantern Language Support"
  4. Click Install

Manual Installation

  1. Download the .vsix file from releases
  2. Run code --install-extension lantern-language-support-0.1.0.vsix

Development Installation

  1. Clone this repository
  2. Run npm install
  3. Press F5 to open a new Extension Development Host window
  4. Open a .ltn file to test the extension

Usage

Creating a New Lantern File

  1. Create a new file with .ltn extension
  2. Start typing any Lantern construct (e.g., module, component)
  3. Use Tab to expand snippets and navigate through placeholders
  4. Enjoy syntax highlighting and auto-completion

Example File

use components::auth::AuthService

Module: UserService
  """
  User management service with authentication
  """
  Description: "Complete user management system"
  Version: "1.0.0"
  Author: "Development Team <[email protected]>"

  Component: UserRepository
    Description: "User data persistence"
    Depends:
      - AuthService
      - DatabaseConnection

    Component: UserCache
      Description: "In-memory user cache"

Event: UserCreated
  Data:
    user_id: String
    email: String
    timestamp: DateTime

Handler: UserCreatedHandler
  On Event: UserCreated
    Given the user data is valid
    Then send welcome email
    And update user statistics

Feature: User Management
  Scenario: Create new user
    Given I have valid user data
    When I create a new user
    Then the user should be saved successfully

  Scenario Template: User validation
    Given I have a user with email "<email>"
    When I validate the user data
    Then I should get "<result>"

    Examples:
      | email           | result  |
      | [email protected]  | success |
      | invalid-email   | error   |

Configuration

Theme Selection

  1. Open Command Palette (Ctrl+Shift+P)
  2. Type "Preferences: Color Theme"
  3. Select "Lantern Dark" or "Lantern Light"

File Association

The extension automatically associates .ltn files with the Lantern language. To manually configure:

{
  "files.associations": {
    "*.ltn": "lantern"
  }
}

Custom Snippets

Add your own snippets by creating a lantern.json file in your VSCode snippets folder:

  1. Open Command Palette (Ctrl+Shift+P)
  2. Type "Preferences: Configure User Snippets"
  3. Select "lantern"
  4. Add your custom snippets

Commands

The extension provides the following commands:

  • Lantern: Validate Syntax - Validates the current Lantern file syntax
  • Lantern: Generate Code - Generates code from the current Lantern specification

Access these commands through:

  • Command Palette (Ctrl+Shift+P)
  • Right-click context menu on .ltn files
  • Editor context menu when viewing .ltn files

Language Server Support

This extension includes basic language features. For advanced features like:

  • Real-time syntax validation
  • Go-to-definition
  • Find references
  • Hover information
  • Code generation

Consider installing the Lantern Language Server extension (when available).

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

  1. Clone the repository
  2. Run npm install
  3. Open in VSCode
  4. Press F5 to launch Extension Development Host
  5. Make changes and test
  6. Submit a pull request

Testing

  • Test files are located in test-fixtures/
  • Run tests with npm test
  • Manual testing in Extension Development Host

Changelog

See CHANGELOG.md for release notes.

Known Issues

  • Large files (>10MB) may experience slower syntax highlighting
  • Complex nested structures might have occasional highlighting glitches
  • Code generation commands require the Lantern CLI to be installed

Report issues at: GitHub Issues

License

This extension is licensed under the MIT License.

Related