gram/packages/vscode-extension
Repository files (latest commit first)
Filename Latest commit message Latest commit date
abiwab 322696526c
Some checks failed
CI / ci (push) Failing after 2m13s
chore: release v1.2.0
2026-08-22 16:28:41 +02:00
..
media feat(renderer): render segmented badge for module provenance and intermediate declaration 2026-08-21 20:20:04 +02:00
snippets chore: exorcise the last remaining °{} and ~&{} haunting the repo 👻 2026-07-13 19:35:17 +02:00
src feat(tooling): normalize diagnostics and error states across playground and vscode 2026-08-19 12:03:47 +02:00
.vscodeignore chore: prepare npm and VS Code Marketplace publishing, rename scope to @gram-lang, make CLI Node-compatible 2026-07-06 11:42:24 +02:00
build.cjs feat(vscode-extension): add Gantt Chart timeline panel and shared renderer module 2026-07-25 20:02:23 +02:00
CHANGELOG.md chore: release v1.2.0 2026-08-22 16:28:41 +02:00
language-configuration.json refactor: Moved source code to new packages folder 2026-01-02 20:16:03 +01:00
LICENSE feat: automate VS Code extension packaging via build script 2026-06-30 21:55:06 +02:00
package.json chore: release v1.2.0 2026-08-22 16:28:41 +02:00
README.md chore: preparing for v1 release 2026-08-06 10:40:53 +02:00
tsconfig.json chore: bump all dependencies and migrate to typescript 7 dual setup 2026-07-13 13:17:12 +02:00

Gram Language Support

VS Code Marketplace License: GPL v3

Part of the Gram monorepo.

The official Visual Studio Code extension for the Gram recipe language. It provides a full language server with real-time diagnostics, advanced editing assistance, semantic highlighting, and a dynamic Live Preview.


📚 General Documentation

For full syntax specifications, grammar details, cheatsheets, and best practices, please refer to the Gram Documentation.


🛠️ Installation

Search for "Gram - Recipe Language" in the Extensions view (Ctrl+Shift+X / Cmd+Shift+X) and install it, or install it directly from the VS Code Marketplace.

Building from source

  1. Clone the repository and navigate to the project root.
  2. Install dependencies and build the monorepo:
    bun install
    bun run build
    
  3. Navigate to the extension folder and package it using vsce (install vsce globally if you haven't already: npm install -g @vscode/vsce):
    cd packages/vscode-extension
    vsce package
    
  4. Install the generated .vsix file in VS Code:
    • Go to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X).
    • Click the ... menu at the top right.
    • Select Install from VSIX... and choose the generated file.

⚡ Features

  • Language Server Protocol (LSP): Real-time diagnostics, missing reference checks, and unused declaration warnings.
  • Live Preview: Real-time side-by-side rendering of the recipe with a built-in, togglable nutrition/macros panel.
  • Gantt Chart View: Provides a precise temporal visualization of your recipe, allowing you to instantly map out active preparation, background wait times, and service scheduling.
  • Smart Autocomplete: Contextual suggestions for ingredients (from your local YAML database), units, and intermediate references.
  • Advanced Navigation: Jump to definition, find all references, outline view, and AST-driven semantic highlighting.
  • Code Actions & Formatting: Automatic document formatting (Format Document / Format on Save via @gram-lang/format), quick fixes for common errors, and volume-to-mass conversions.
  • Inlay Hints & CodeLens: Displays cumulative time and quick action buttons directly in the editor.

🏗️ Structure

  • src/extension.ts: Main entry point for the extension client.
  • src/preview.ts: Manages the Live Preview webview panel and HTML rendering.
  • src/gantt-panel.ts: Manages the Gantt Chart timeline webview panel.
  • src/gantt-webview-entry.ts: Client-side interactivity bundle entry point for the Gantt webview.
  • syntaxes/: Contains the fallback TextMate grammar for Gram.
  • snippets/: Built-in code snippets for standard recipe structures.
  • ../language-server: The LSP implementation providing all intelligence to this extension.

📄 License

This project is licensed under the GPL-3.0 License.