Skip to main content

Overview

The Simforge VS Code extension provides IDE integration for working with Simforge functions:
  • Jump to Portal: Quickly open functions in the Simforge web portal from your code
  • Type Checking: Get real-time type checking for simforge.call() invocations (TypeScript only)

Installation

From VS Code Marketplace

  1. Open VS Code
  2. Go to Extensions (Cmd+Shift+X or Ctrl+Shift+X)
  3. Search for “Simforge”
  4. Click Install

From Command Line

code --install-extension harvest.simforge-vscode

Configuration

Set API Key

The extension needs your Simforge API key to fetch function schemas for type checking. Option 1: Settings UI
  1. Open VS Code Settings (Cmd+, or Ctrl+,)
  2. Search for “Simforge”
  3. Enter your API key in the Simforge: Api Key field
Option 2: Command Palette
  1. Open Command Palette (Cmd+Shift+P or Ctrl+Shift+P)
  2. Run Simforge: Set API Key
  3. Enter your API key
Option 3: settings.json
{
  "simforge.apiKey": "sf_your_api_key_here"
}

Configuration Options

SettingTypeDefaultDescription
simforge.apiKeystring""Your Simforge API key
simforge.typeChecking.enabledbooleantrueEnable type checking for simforge.call()
simforge.typeChecking.cacheTimeoutnumber300000Cache timeout in milliseconds (default: 5 minutes)

Features

Jump to Portal

Hover over a simforge.call() invocation and click Open in Simforge Portal to open the function in your browser. Or use the Command Palette:
  1. Place your cursor on a simforge.call() invocation
  2. Open Command Palette (Cmd+Shift+P or Ctrl+Shift+P)
  3. Run Simforge: Open in Portal

Type Checking

The extension provides real-time type checking for function calls:
// Valid call - no errors
const result = await client.call("ExtractName", {
  text: "John Doe",
})

// Invalid call - shows error squiggle
const result = await client.call("ExtractName", {
  text: 123, // Error: Expected string, got number
})

// Missing required field - shows error
const result = await client.call("ExtractName", {
  // Error: Missing required field 'text'
})

Refresh Types

If you’ve updated a function in the portal, refresh the cached schemas:
  1. Open Command Palette (Cmd+Shift+P or Ctrl+Shift+P)
  2. Run Simforge: Refresh Types
Or click the refresh icon in the status bar.

Clear Cache

To clear all cached data:
  1. Open Command Palette (Cmd+Shift+P or Ctrl+Shift+P)
  2. Run Simforge: Clear Cache

Commands

CommandDescription
Simforge: Set API KeySet your Simforge API key
Simforge: Open in PortalOpen current function in web portal
Simforge: Refresh TypesRefresh cached function schemas
Simforge: Clear CacheClear all cached data

Supported Languages

The extension supports type checking in:
  • TypeScript (.ts, .tsx)

Troubleshooting

Type checking not working

  1. Ensure your API key is set correctly
  2. Check that the function name matches exactly (case-sensitive)
  3. Try running Simforge: Refresh Types
  4. Check the Output panel (View > Output > Simforge) for errors

Extension not activating

The extension activates when you open a TypeScript file. Check:
  1. The file has the correct extension (.ts or .tsx)
  2. The extension is installed and enabled
  3. Reload VS Code (Developer: Reload Window)

Connection errors

If you’re getting connection errors:
  1. Check your internet connection
  2. Ensure your API key is valid
  3. Check if you’re behind a firewall or proxy