Official Website • GitHub • VS Code Marketplace • Cursor Marketplace
T-Ruby language support for VS Code and Cursor. Provides syntax highlighting, LSP-based code intelligence, and development tools for T-Ruby - a TypeScript-style static type system for Ruby.
Note: This extension shares the same source code for both VS Code and Cursor, providing identical functionality in both editors.
- T-Ruby Compiler (
trc) must be installed and available in your PATH
gem install t-rubyInstall from the Visual Studio Marketplace:
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "T-Ruby"
- Click Install
Or install via command line:
code --install-extension t-ruby.t-rubyInstall from the Open VSX Registry:
- Open Cursor
- Go to Extensions (Ctrl+Shift+X)
- Search for "T-Ruby"
- Click Install
After installation, configure the extension in VS Code settings (Ctrl+,):
{
"t-ruby.lspPath": "trc",
"t-ruby.enableLSP": true,
"t-ruby.diagnostics.enable": true,
"t-ruby.completion.enable": true
}| Option | Type | Default | Description |
|---|---|---|---|
t-ruby.lspPath |
string | "trc" |
Path to T-Ruby compiler |
t-ruby.enableLSP |
boolean | true |
Enable Language Server |
t-ruby.diagnostics.enable |
boolean | true |
Enable real-time diagnostics |
t-ruby.completion.enable |
boolean | true |
Enable autocomplete |
The extension provides full syntax highlighting for:
.trbfiles (T-Ruby source files).d.trbfiles (T-Ruby declaration files)
Type annotations, interfaces, and type aliases are highlighted distinctly.
- Autocomplete: Type suggestions for parameters and return types
- Hover: View type information by hovering over symbols
- Go to Definition: Navigate to type/function definitions
Real-time error checking for:
- Unknown types
- Duplicate definitions
- Syntax errors
Access via Command Palette (Ctrl+Shift+P):
| Command | Description |
|---|---|
T-Ruby: Compile Current File |
Compile the active .trb file |
T-Ruby: Generate Declaration File |
Generate .d.trb from source |
T-Ruby: Restart Language Server |
Restart the LSP server |
- 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
-
Save the file - you'll see syntax highlighting and real-time diagnostics
-
Hover over types to see their definitions
-
Use
Ctrl+Spacefor autocomplete suggestions
- Check if
trcis installed:which trc - Verify the path in settings:
t-ruby.lspPath - Check Output panel: View > Output > T-Ruby Language Server
- Ensure file has
.trbor.d.trbextension - Check file association: View > Command Palette > "Change Language Mode"
- Disable diagnostics for large files:
"t-ruby.diagnostics.enable": false - Restart the language server: Command Palette > "T-Ruby: Restart Language Server"
Issues and pull requests are welcome! https://github.com/type-ruby/t-ruby-vscode/issues
- T-Ruby Compiler - The main T-Ruby compiler
- T-Ruby JetBrains - JetBrains IDE plugin
- T-Ruby Vim - Vim/Neovim plugin
BSD 2-Clause