Skip to content

type-ruby/t-ruby-jetbrains

Repository files navigation

T-Ruby

T-Ruby for JetBrains IDEs

Official Website   •   GitHub   •   JetBrains Marketplace

JetBrains Plugin JetBrains Downloads T-Ruby Compiler License


T-Ruby language support for JetBrains IDEs. Provides syntax highlighting, LSP-based code intelligence, and development tools for T-Ruby - a TypeScript-style static type system for Ruby.

Note: This plugin works with all JetBrains IDEs including IntelliJ IDEA, RubyMine, WebStorm, and more.

Supported IDEs

  • IntelliJ IDEA 2024.2+ (Ultimate & Community)
  • RubyMine 2024.2+
  • WebStorm 2024.2+
  • PyCharm 2024.2+
  • GoLand 2024.2+
  • And other JetBrains IDEs based on IntelliJ Platform 2024.2+

Features

  • Syntax highlighting for .trb and .d.trb files
  • LSP-based code intelligence (via LSP4IJ):
    • Real-time diagnostics (type errors)
    • Autocomplete suggestions
    • Go to definition
    • Hover information
  • Actions:
    • Compile T-Ruby File (Ctrl+Shift+T / Cmd+Shift+T)
    • Generate Declaration File (Ctrl+Shift+D / Cmd+Shift+D)

Requirements

  • T-Ruby Compiler (trc) must be installed and available in your PATH
  • LSP4IJ plugin (will be installed automatically as dependency)
gem install t-ruby

Installation

Install from the JetBrains Marketplace:

  1. Open your JetBrains IDE
  2. Go to Settings/Preferences → Plugins
  3. Search for "T-Ruby"
  4. Click Install

Configuration

Configure the T-Ruby compiler path in: Settings/Preferences → Tools → T-Ruby

Setting Default Description
trc Path trc Path to the T-Ruby compiler executable
Enable LSP true Enable Language Server Protocol support
Enable Diagnostics true Enable real-time diagnostics
Enable Completion true Enable autocomplete suggestions

Compatibility

Plugin Version T-Ruby Compiler JetBrains IDEs
0.1.x >= 0.0.30 2024.2 - 2025.4

Building from Source

# Build the plugin
./gradlew buildPlugin

# Run IDE with plugin for testing
./gradlew runIde

# Run tests
./gradlew test

Development

Quick Iteration (Hot Reload)

For rapid development with automatic rebuilds:

./scripts/dev.sh

This starts the IDE and watches for file changes. When you save a file, the plugin rebuilds automatically and reloads in the running IDE.

Requirements: fswatch (brew install fswatch)

Quick Start Example

  1. Create a new file hello.trb:
type UserId = String

interface User
  id: UserId
  name: String
  age: Integer
end

def greet(user: User): String
  "Hello, #{user.name}!"
end
  1. Save the file - you'll see syntax highlighting and real-time diagnostics

  2. Hover over types to see their definitions

  3. Use Ctrl+Space for autocomplete suggestions

Troubleshooting

Plugin not working

  1. Check if trc is installed: which trc
  2. Verify the path in settings: Settings > Tools > T-Ruby
  3. Check IDE logs: Help > Show Log in Finder/Explorer

No syntax highlighting

  1. Ensure file has .trb or .d.trb extension
  2. Check file type association: Settings > Editor > File Types

Performance issues

  • Disable diagnostics for large files
  • Restart the IDE

Contributing

Issues and pull requests are welcome! https://github.com/type-ruby/t-ruby-jetbrains/issues

Related

License

MIT

About

T-Ruby extention for Jetbrains Marketplace

Resources

License

Stars

Watchers

Forks

Packages

No packages published