-
Notifications
You must be signed in to change notification settings - Fork 127
Create rs.lua #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Create rs.lua #174
Conversation
WalkthroughA new Lua plugin file has been introduced to define syntax highlighting rules for a Rust-like language. The plugin specifies reserved keywords, arithmetic operators, and adds a custom comment string. No changes were made to control flow, error handling, or public API declarations. Changes
Poem
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. ✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
Lua/Plugins/rs.lua (2)
1-4
: Group reserved keywords into a table to reduce duplication.
Instead of individualhighlight
calls, consider:local keywords = { "const", "fn", "let", "mut" } for _, kw in ipairs(keywords) do highlight(kw, "reserved") endThis makes it easier to add or remove keywords.
Also consider expanding with other Rust keywords likestruct
,enum
,impl
, etc.
5-9
: Consolidate operator highlighting and extend coverage.
Group operators into a list and loop:local ops = { "+", "-", "*", "/", "%" } for _, op in ipairs(ops) do highlight(op, "operator") endAdditionally, you may want to include comparison (
==
,!=
,<
,>
) and bitwise (&
,|
,^
,<<
,>>
) operators for fuller Rust support.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
Lua/Plugins/rs.lua
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
Lua/Plugins/rs.lua (1)
definitions.lua (2)
highlight
(6-6)add_comment
(17-17)
highlight("%", "operator") | ||
|
||
|
||
add_comment("add some raw pointers trust") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use proper comment delimiter(s) for Rust syntax highlighting.
The current call add_comment("add some raw pointers trust")
appears to be placeholder text rather than actual Rust comment syntax. To ensure comments are highlighted, register the real comment tokens. For example:
-add_comment("add some raw pointers trust")
+add_comment("//") -- single-line comments
+add_comment("/*") -- block comment start (if supported)
+add_comment("*/") -- block comment end (if supported)
Without valid delimiters, comment highlighting won’t function.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
add_comment("add some raw pointers trust") | |
add_comment("//") -- single-line comments | |
add_comment("/*") -- block comment start (if supported) | |
add_comment("*/") -- block comment end (if supported) |
basic rust syntax highlighting (better than nothing)
Summary by CodeRabbit