|
1 | | -# t-ruby-vscode |
| 1 | +# T-Ruby for Visual Studio Code |
| 2 | + |
| 3 | +[](https://marketplace.visualstudio.com/items?itemName=t-ruby.t-ruby) |
| 4 | +[](https://open-vsx.org/extension/t-ruby/t-ruby) |
| 5 | +[](https://marketplace.visualstudio.com/items?itemName=t-ruby.t-ruby) |
| 6 | +[](https://rubygems.org/gems/t-ruby) |
| 7 | +[](LICENSE) |
| 8 | + |
| 9 | +T-Ruby language support for Visual Studio Code. Provides syntax highlighting, LSP-based code intelligence, and development tools for [T-Ruby](https://github.com/type-ruby/t-ruby) - a TypeScript-style static type system for Ruby. |
| 10 | + |
| 11 | +## Features |
| 12 | + |
| 13 | +- Syntax highlighting for `.trb` and `.d.trb` files |
| 14 | +- LSP-based code intelligence: |
| 15 | + - Real-time diagnostics (type errors) |
| 16 | + - Autocomplete suggestions |
| 17 | + - Go to definition |
| 18 | + - Hover information |
| 19 | +- Commands: |
| 20 | + - `T-Ruby: Compile Current File` - Compile the current `.trb` file |
| 21 | + - `T-Ruby: Generate Declaration File` - Generate `.d.trb` declaration file |
| 22 | + - `T-Ruby: Restart Language Server` - Restart the LSP server |
| 23 | + |
| 24 | +## Requirements |
| 25 | + |
| 26 | +- [T-Ruby Compiler](https://github.com/type-ruby/t-ruby) (`trc`) must be installed and available in your PATH |
| 27 | + |
| 28 | +```bash |
| 29 | +gem install t-ruby |
| 30 | +``` |
| 31 | + |
| 32 | +## Installation |
| 33 | + |
| 34 | +### VS Code |
| 35 | + |
| 36 | +Install from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=t-ruby.t-ruby): |
| 37 | + |
| 38 | +1. Open VS Code |
| 39 | +2. Go to Extensions (Ctrl+Shift+X) |
| 40 | +3. Search for "T-Ruby" |
| 41 | +4. Click Install |
| 42 | + |
| 43 | +Or install via command line: |
| 44 | + |
| 45 | +```bash |
| 46 | +code --install-extension t-ruby.t-ruby |
| 47 | +``` |
| 48 | + |
| 49 | +## Cursor |
| 50 | + |
| 51 | +This extension is also available for [Cursor](https://cursor.com), a fork of VS Code. |
| 52 | + |
| 53 | +- **Same codebase**: Cursor uses the same extension code as VS Code |
| 54 | +- **Different marketplace**: Install from Open VSX Registry instead of VS Code Marketplace |
| 55 | + |
| 56 | +Install for Cursor: |
| 57 | +- Open VSX: https://open-vsx.org/extension/t-ruby/t-ruby |
| 58 | + |
| 59 | +## Configuration |
| 60 | + |
| 61 | +| Setting | Default | Description | |
| 62 | +|---------|---------|-------------| |
| 63 | +| `t-ruby.lspPath` | `trc` | Path to the T-Ruby compiler executable | |
| 64 | +| `t-ruby.enableLSP` | `true` | Enable Language Server Protocol support | |
| 65 | +| `t-ruby.diagnostics.enable` | `true` | Enable real-time diagnostics | |
| 66 | +| `t-ruby.completion.enable` | `true` | Enable autocomplete suggestions | |
| 67 | + |
| 68 | +## Compatibility |
| 69 | + |
| 70 | +| Extension Version | T-Ruby Compiler | |
| 71 | +|-------------------|-----------------| |
| 72 | +| 0.1.x | >= 0.0.30 | |
| 73 | + |
| 74 | +## Related |
| 75 | + |
| 76 | +- [T-Ruby Compiler](https://github.com/type-ruby/t-ruby) - The main T-Ruby compiler |
| 77 | +- [T-Ruby JetBrains](https://github.com/type-ruby/t-ruby-jetbrains) - JetBrains IDE plugin |
| 78 | +- [T-Ruby Vim](https://github.com/type-ruby/t-ruby-vim) - Vim/Neovim plugin |
| 79 | + |
| 80 | +## License |
| 81 | + |
| 82 | +MIT |
0 commit comments