🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

effect-sugar

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

effect-sugar

Syntax highlighting and TypeScript support for Effect-TS gen blocks

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

Effect Sugar VSCode Extension

Provides syntax highlighting and TypeScript error suppression for Effect-TS gen blocks.

Features

  • Syntax highlighting for gen { } blocks and <- operator
  • TypeScript error suppression inside gen blocks (via TS plugin)
  • Code actions explaining suppressed errors

Installation

Development Installation

  • Install dependencies:

    cd packages/effect-sugar/vscode-extension
    npm install
    
  • Compile the extension:

    npm run compile
    
  • Open VSCode and press F5 to launch the Extension Development Host

TypeScript Plugin Setup

To enable error suppression, add the TypeScript plugin to your tsconfig.json:

{
  "compilerOptions": {
    "plugins": [
      { "name": "effect-sugar-ts-plugin" }
    ]
  }
}

Then tell VSCode to use the workspace TypeScript version:

  • Open Command Palette (Cmd+Shift+P)
  • Run "TypeScript: Select TypeScript Version"
  • Choose "Use Workspace Version"

Usage

Files with .gen.ts extension will automatically use the Effect Sugar language mode.

For regular .ts files, the syntax injection grammar will highlight gen blocks.

Example

// This will be highlighted and errors suppressed
const program = gen {
  user <- getUser(id)
  profile <- getProfile(user.id)
  return { user, profile }
}

Configuration

SettingDefaultDescription
effectSugar.suppressDiagnosticstrueSuppress TypeScript diagnostics inside gen blocks

How It Works

  • TextMate Grammar: Provides syntax highlighting for gen, <-, and variable bindings
  • Injection Grammar: Highlights gen blocks in regular .ts/.tsx files
  • TypeScript Plugin: Hooks into the language service to filter diagnostics

Known Limitations

  • Full type inference inside gen blocks requires the build transformation to run
  • Hover information shows raw syntax, not inferred types
  • Go-to-definition for bound variables doesn't work inside gen blocks

Development

# Install dependencies
npm install

# Compile
npm run compile

# Watch mode
npm run watch

# Package extension
npm run package

Roadmap

  • Semantic token provider for better highlighting
  • Hover information showing transformed code
  • Go-to-definition support for bound variables
  • Auto-complete for Effect methods

FAQs

Package last updated on 25 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts