feat: Add Ruby syntax highlight support#849
Open
toshimaru wants to merge 3 commits intomicrosoft:mainfrom
Open
feat: Add Ruby syntax highlight support#849toshimaru wants to merge 3 commits intomicrosoft:mainfrom
toshimaru wants to merge 3 commits intomicrosoft:mainfrom
Conversation
Author
|
@microsoft-github-policy-service agree |
There was a problem hiding this comment.
Pull request overview
Adds first-class Ruby support to the LSH syntax-highlighting system by introducing a Ruby lexer definition and a corresponding highlighting fixture for visual verification.
Changes:
- Added a new Ruby
.lshdefinition with file associations for common Ruby filenames and extensions. - Implemented highlighting rules for Ruby comments, strings, numbers, keywords, constants, variables/symbols, and method defs/calls.
- Added
assets/highlighting-tests/ruby.rbto exercise the new token categories.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| crates/lsh/definitions/ruby.lsh | New Ruby highlighting definition and file associations. |
| assets/highlighting-tests/ruby.rb | New Ruby fixture file to manually/visually validate highlighting behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1f20410 to
0a5f32e
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Fix Ruby keyword and variable highlighting
- use `keyword.control` for `end`
0a5f32e to
07cbc0d
Compare
lczyk
added a commit
to lczyk/edit-lczyk-remix
that referenced
this pull request
May 5, 2026
ports microsoft#849 by toshimaru. adds an lsh definition for ruby and a kitchen-sink fixture covering comments, strings, numerics, keywords, constants, variables, symbols, and method defs. registered for *.rb, *.rake, *.ru, Gemfile, Rakefile. local additions on top of the upstream PR: - #[line_comment = "#"] attr to match this fork's other defs - fixture lives under crates/lsh/tests/fixtures/ruby/ w/ a .jsonl golden snapshot, per the local golden-test layout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an LSH definition for Ruby and a matching highlighting-test fixture.
Registered for
*.rb,*.rake,*.ru,Gemfile, andRakefile. The definition covers:#…) and block (=begin/=end)\.escapes0x…), binary (0b…), octal (0o…), floats and exponents, with_separators andr/irational/imaginary suffixesif,case,while,rescue, …) and other (class,module,def,self,super, …)true,false,nil, and capitalized identifiers@ivar,@@cvar,$gvar,:symbol!/?/=suffixesassets/highlighting-tests/ruby.rbexercises each category for visual verification.Screenshot