Developer kulkarniniraj has released yajlsp, a new Language Server Protocol extension for VS Code that brings serious tooling to the Janet programming language. The extension, which replaces the previous 'Janet LSP' and 'jajlsp' packages, introduces robust structural editing features alongside standard IDE capabilities like symbol lookup and formatting. While the project notes that most of the code was generated using Codex with task-specific prompts, the resulting toolset offers a compelling workflow for Lisp-family language developers who have long felt neglected by mainstream editor support.

Structural Editing and Core Features

The standout feature of yajlsp is its implementation of structural editing commands, specifically 'Slurp Forward' and 'Barf Forward.' These two-step key chords allow developers to manipulate s-expressions without manual parenthesis matching. Slurp pulls the next expression into the current form, transforming (a b) c into (a b c), while Barf pushes the rightmost expression out, reversing the operation. These commands support parenthesized forms, vectors, arrays, and maps, preserving whitespace and comments while ensuring the cursor does not cross enclosing form boundaries. Each action is treated as a single undo step, integrating seamlessly with VS Code's history management. Beyond structural editing, the extension provides comprehensive language intelligence. It supports go-to-definition, find-references, and hover documentation for local bindings, workspace symbols, and qualified imports. The tool also handles diagnostics by reporting parser errors directly in the editor, though it currently only surfaces the first error in a file. For formatting, yajlsp integrates with Spork's fmt command, automatically cleaning up code on save unless the file contains parser errors, which are left unchanged to prevent further corruption.

Native Module Support and Installation

A significant technical addition is the support for native modules. The extension caches public exports from installed native modules, such as spork/json and HTTP packages, providing documentation and autocomplete suggestions for these external dependencies. This metadata generation runs in the background at startup, initializing each module in a separate subprocess with a configurable timeout (defaulting to 5 seconds). This approach ensures that the LSP remains responsive even when dealing with complex native extensions, although it requires that Janet and the jpm package manager be installed on the machine running the VS Code extension host. Installation is straightforward for Linux and macOS users, requiring VS Code 1.91 or later and the cat utility on the PATH. Windows users must utilize WSL or SSH workspaces. The extension bundles the JavaScript client and language server, meaning Node.js and npm are not required on the target machine. Users upgrading from the old janetLsp or jajlsp extensions must uninstall the previous versions and rename any existing settings to the new yajlsp namespace to avoid configuration conflicts.

Key Takeaways

  • Structural Editing: Introduces Slurp and Barf commands for efficient s-expression manipulation in VS Code.
  • Native Module Intelligence: Provides autocomplete and docs for native Janet modules via background metadata caching.
  • Platform Constraints: Requires Linux/macOS or WSL/SSH for Windows; needs Janet and jpm installed on the host.
  • AI-Assisted Development: The project leverages Codex for code generation, highlighting a trend in indie tool development.

The Bottom Line

For Janet developers tired of fighting with parentheses in a basic text editor, yajlsp is a massive quality-of-life upgrade. The addition of structural editing alone justifies the switch, proving that niche languages can have first-class tooling if someone builds it.