Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Sorbetto for VS CodeNew to Visual Studio Code? Get it now.
Sorbetto for VS Code

Sorbetto for VS Code

damolinx

|
44 installs
| (0) | Free
Sorbetto provides Ruby Language features using Sorbet, a type checker for Ruby.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Sorbetto for VS Code

Sorbetto is a Visual Studio Code extension that provides language support for Ruby via Sorbet, a type checker developed by Stripe. It began as a fork of the official Ruby Sorbet extension, originally created to explore improvements in code maintainability and user experience (UX). Since then, Sorbetto's internals have been extensively rewritten, and new functionality has been added. While it continues to serve as an experimentation platform, it now follows its own path—compatibility with the original extension is no longer a priority. Note that both extensions rely on the same Sorbet Language Server, so any differences in behavior occur exclusively in the VS Code layer.

Features

  • Multi-root workspace support, including separate Sorbet LSP instances per workspace folder
  • Uses the Language Status Item to report status
  • Improved configuration model
  • Getting started experience:
    • Set up a workspace for Ruby development via the Setup Workspace command
    • Gemfile files include an Install action
    • Provides code snippets for standard Sorbet constructs
  • Autocomplete is enabled in several contexts:
    • require_relative statements
    • gem entries in Gemfile files
    • # typed sigils
  • Improved quickfix actions, e.g., fix all instances of a given error code across all files (documentation).

Some of the maintainability updates:

  • Minimum VS Code version updated to 1.99, enabling use of more recent extensibility APIs.
  • Language Client library upgraded to version 9.0.
  • Migrated to esbuild for minification and bundling, reducing extension footprint significantly.

Platform Support: The extension uses cross-platform practices wherever possible. Its compatibility is limited only by the platforms supported by Sorbet. As a result, Windows-specific codepaths are rarely exercised since Sorbet does not support the platform.

Table of Contents

  • Getting Started
    • Setting Up a Workspace
    • Running a Ruby Script
  • Sorbet Language Status Item
  • Sorbet Configuration
  • Sorbet Snippets
  • Multi-root Workspaces
  • Workspace Setup
  • Gemfile
  • Extension Logs

Getting Started

Setting Up a Workspace

  1. Open an existing workspace, or create a new one from an empty folder.
  2. Run the Sorbetto: Setup Workspace command.
  3. Your workspace is ready to use.

Running a Ruby Script

  1. Create a new Ruby file, such as main.rb.
  2. Add some content to it — you can use the Snippets: Fill File with Snippet command and select a ruby snippet.
  3. Run the file using the Sorbetto: Run Ruby File command.
    • Later, you may want to create a Launch Configuration, but this command is the fastest way to run a standalone script.

↑ Back to top

Sorbet Language Status Item

Sorbetto uses a Language Status Item for Ruby to report LSP status. This approach provides a unified, consistent UI that can display multiple status entries with associated actions. Specific entries can also be pinned to the status bar for quick access, preserving the familiar UX from the official extension.

Ruby Language Item with Sorbetto entries and statusbar-pinned Status item with Sorbet in Idle state target Stable configuration

The following entries are available on the language status item:

  • Sorbet Configuration: shows the active Sorbet LSP configuration name as set via sorbetto.sorbetLspConfiguration, along with a quick Configure action to modify it.
  • Sorbet Status: displays the current status of the Sorbet LSP, including a busy indicator. The Output action brings the Sorbetto Output pane into view for checking log entries.

VS Code displays the language status item only when an editor for the matching language is open. You can extend this behavior to editors of any language by enabling the Sorbetto: Always Show Status Items setting. However, at least one editor must still be open for the item to appear.

When using multi-root workspaces, the currently focused editor determines which LSP instance's status is shown. At present, there is no mechanism to display status across all instances simultaneously.

↑ Back to top

Sorbet Configuration

Use the Settings Editor to modify the configuration values used by the extension.

The most important setting is the Sorbet Lsp Configuration which provides the following values:

  • Stable: runs the Sorbet LSP using bundle exec srb typecheck, and any other settings values you might have added.
  • Custom: runs the Sorbet LSP using a custom command and arguments you provide in the Sorbet Lsp Custom Configuration setting.
  • Disabled: disables Sorbet entirely.

When compared to the official extension, Beta and Experimental are not configuration modes here but instead settings you can enable separately. Additionally, a limited set of features are exposed as standalone settings, such as Enable RBS support and Enable require_ancestor support. It is expected over time the number of settings will grow. The extension attempts to de-duplicate configuration values whenever they might overlap.

You can also edit the sorbet/config file in your workspace directly. However, the extension does not process this file, so you may inadvertently create conflicting configurations. For details, see the Sorbet: Config file documentation.

↑ Back to top

Sorbet Snippets

Sorbetto provides snippets for standard Sorbet constructs on top of the ones offered by Sorbet already. In particular, a whole set of ruby language snippets are now available via the Snippet: Fill File with Snippet and Snippet: Insert Snippet commands. All snippets have an associated trigger word recognized by IntelliSense while typing, making them easily accessible. For example, typing abstract will display the snippets for an abstract class, module, or method, allowing for quick and intuitive code insertion.

Sorbet snippets provided by Sorbetto

Multi-root Workspaces

Multi-root workspaces let developers work with multiple workspace folders within a single VS Code window. This model requires extensions to resolve all references relative to the correct project root, and to follow specific workspace-aware behaviors. Starting with version 0.3.0, Sorbetto creates a dedicated Sorbet LSP client for each configured workspace folder. This is especially useful when working on multiple projects with distinct dependencies, or when those dependencies need to be isolated—such as separating frontend and backend environments.

There are two key aspects to be aware of:

  • Context resolution: When determining the target of an action—such as displaying language status items—Sorbetto uses the currently active text editor as a hint. If the target workspace cannot be inferred, a dropdown will prompt for selection. This typically occurs with VS Code stock commands that don’t accept a URI as context.

  • Configuration precedence: Settings are read in the following order: first from the workspace folder, then the overall workspace, and finally the user scope. Be sure to configure values at the appropriate level. Note that UI settings can only be set at the workspace or user level. This is often the most nuanced aspect of managing multi-root workspaces, so refer to the documentation if needed.

↑ Back to top

Workspace Setup

The Setup Workspace command automates all steps from Adopting Sorbet in one convenient place. This command configures bundler to install gems locally via bundle config set --local path 'vendor/bundle'.

Note: Do not use this command if you prefer globally installed gems; instead, follow the linked documentation to set up your workspace.

↑ Back to top

Gemfile Tools

CodeLens actions are added to Gemfile files, making it easy to Install or Update dependencies using bundler. Additionally, gem statements get gem-name autocompletion, queried in real-time from rubygems.org.

↑ Back to top

Extension Logs

Sorbetto uses a single output channel to log both its own exceptions and Sorbet’s. The log level can be controlled via the standard Developer: Set Log Level command, selecting Sorbetto from the dropdown. See documentation for details.

↑ Back to top

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft