Skip to content

Support comment-prefix operators like /// and /**#123

Merged
davidshepherd7 merged 7 commits intomasterfrom
comment-operator-handling
Mar 14, 2026
Merged

Support comment-prefix operators like /// and /**#123
davidshepherd7 merged 7 commits intomasterfrom
comment-operator-handling

Conversation

@davidshepherd7
Copy link
Copy Markdown
Owner

Summary

  • Add a new electric-operator-comment-prefix action symbol for rules that represent comment openers (e.g. //, /*, ///)
  • When inside a comment, only rules using this action are applied — normal operators are not expanded
  • Add /// rule for Rust doc-comments (fixes Support rust doc-comments - /// #86)
  • Remove electric-operator-enable-in-docs option (simplifies the implementation)
  • Convert all comment // and /* rules across C, C++, JS, Rust, Java, PHP, and Swift to use the new action

Test plan

  • All existing tests pass (309 tests, 0 unexpected failures)
  • Rust /// doc-comments work correctly
  • JS comment-after-division case also fixed
  • Operators are not expanded inside comments (new tests)
  • Benchmarks show no significant performance regression

🤖 Generated with Claude Code

@davidshepherd7 davidshepherd7 force-pushed the comment-operator-handling branch from 783d926 to 038fd34 Compare March 14, 2026 13:03
davidshepherd7 and others added 2 commits March 14, 2026 13:07
Re-enable the - operator for sql-mode (was previously disabled) and
add -- as a comment-prefix rule.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@davidshepherd7 davidshepherd7 merged commit ef39e07 into master Mar 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support rust doc-comments - ///

1 participant