Skip to content

Zack-911/forgevsc

Repository files navigation

ForgeLSP VS Code Extension

VS Code TypeScript GitHub License

A powerful VS Code extension for ForgeScript development with intelligent code assistance


✨ Features

🚀 Automatic Binary Management

  • Cross-platform support: Linux (x86_64, aarch64), macOS (x86_64, Apple Silicon), Windows (x86_64)
  • Auto-download: Automatically downloads the correct LSP binary for your platform on first run
  • Auto-updates: Detects and prompts for new LSP versions from GitHub releases
  • Version tracking: Maintains metadata files to track installed binary versions

📝 Workspace Configuration

  • forgeconfig.json: Central configuration file for your ForgeScript project
  • Create Config Command: Generate a new configuration file with a single command
  • Auto-activation: Extension activates automatically when forgeconfig.json is present

🔧 Language Server Features

Hover Information

  • Rich markdown documentation for ForgeScript functions
  • Displays function signatures with argument types
  • Shows examples from function metadata
  • Indicates optional/required parameters

Intelligent Completions

  • Context-aware function suggestions triggered by $
  • Category-based function grouping
  • Detailed documentation in completion items

Signature Help

  • Real-time parameter hints while typing
  • Active parameter highlighting
  • Support for nested function calls
  • Handles complex bracket/semicolon syntax

Semantic Highlighting

  • Syntax highlighting for functions, strings, numbers, booleans
  • Works within code blocks in string templates
  • Consistent visual distinction for ForgeScript syntax

Diagnostics

  • Real-time error detection
  • Unknown function warnings
  • Argument count validation
  • Bracket matching errors

🛠️ Installation

  1. Install from the VS Code marketplace (or build from source)
  2. Open a project with a forgeconfig.json file, or create one:
    • Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
    • Run: Create Forge Config
  3. The extension will prompt to download the LSP binary

📋 Commands

Command Description
ForgeScript: Create Forge Config Creates a forgeconfig.json in the workspace root
ForgeScript: Update ForgeLSP Binary Manually check for and install LSP updates
ForgeScript: Use Custom LSP Binary Manually select a custom LSP binary

⚙️ Configuration

forgeconfig.json

{
  "$schema": "vscode://schemas/forgeconfig",
  "urls": [
    "github:tryforge/forgescript" // Branch can be specified by using # such as github:tryforge/forgescript#dev
  ],
  "logLevel": "info"
}

Extension Settings

Setting Type Default Description
logLevel string "info" Log level for the server (trace, debug, info, warn, error)
forgevsc.trace.server string "off" Traces communication between VS Code and the language server (off, messages, verbose)

🏗️ Architecture

forgevsc/
├── src/
│   └── extension.ts    # Main extension entry point
├── syntaxes/
│   ├── forge.tmLanguage.json    # ForgeScript syntax grammar
│   └── injection.json           # JS/TS injection grammar
├── schema.json                  # forgeconfig.json schema
└── package.json                 # Extension manifest

Key Components

  • Binary Detection: Platform-specific binary selection based on OS and architecture
  • Metadata Management: Stores version info alongside binaries for update detection
  • Error Handling: Graceful degradation with comprehensive error recovery
  • Progress Notifications: User-friendly download progress indicators

📊 Supported Platforms

Platform Architecture Binary Name
Linux x86_64 forgevsc-linux-x86_64
Linux ARM64 forgevsc-linux-aarch64
macOS x86_64 forgevsc-macos-x86_64
macOS Apple Silicon forgevsc-macos-aarch64
Windows x86_64 forgevsc-windows-x86_64.exe

🔗 Related Projects

  • ForgeLSP - The Rust-based Language Server Protocol implementation
  • ForgeScript - The ForgeScript language

📄 License

GPL-3 License - See LICENSE for details.

About

The Visual Studio Code Extension For ForgeScript

Resources

License

Stars

Watchers

Forks

Packages

No packages published