Conversation
WalkthroughA new Solidity rule entry was added to the dumb-jump.el ruleset. The rule recognizes Solidity struct-type definitions using the regex pattern Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
dumb-jump.el (1)
1422-1422: Consider\\s+instead of\\s*betweenstructandJJJPer the Solidity grammar,
structDefinitionrequires at least one whitespace between thestructkeyword and the name —\\s*(zero-or-more) would theoretically matchstructMyType{(no space), which is invalid Solidity. That said, this is consistent with every other Solidity rule in the file (function, modifier, event, error, contract all use\\s*), so the false-positive risk in practice is negligible.♻️ Proposed change (for consistency with grammar)
- :regex "struct\\s*JJJ\\s*\\\{" + :regex "struct\\s+JJJ\\s*\\\{"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@dumb-jump.el` at line 1422, Update the Solidity struct regex to require at least one whitespace between the `struct` keyword and the identifier: in the entry that sets `:regex "struct\\s*JJJ\\s*\\\{"` replace the `\\s*` between `struct` and `JJJ` with `\\s+` so the pattern becomes `struct\\s+JJJ\\s*\\\{`; this ensures `structMyType{` won't match while leaving the trailing `\\s*` before the brace unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@dumb-jump.el`:
- Line 1422: Update the Solidity struct regex to require at least one whitespace
between the `struct` keyword and the identifier: in the entry that sets `:regex
"struct\\s*JJJ\\s*\\\{"` replace the `\\s*` between `struct` and `JJJ` with
`\\s+` so the pattern becomes `struct\\s+JJJ\\s*\\\{`; this ensures
`structMyType{` won't match while leaving the trailing `\\s*` before the brace
unchanged.
Rule based on https://docs.soliditylang.org/en/latest/grammar.html#a4.SolidityParser.structDefinition
Summary by CodeRabbit
Release Notes