Commit 3ce9025
committed
feat: add support for RBS inline type annotations
Adds recognition of RBS (Ruby Signature) inline type annotation comments
to enable better editor support for Ruby type annotations.
Changes:
- Add rbs_type_comment token for #: comments
- Add rbs_continuation_comment token for #| comments
- Include both tokens in extras to allow them anywhere
- Add highlighting queries to style RBS comments as @type.annotation
- Add comprehensive test coverage with 11 test cases
This implementation intentionally only recognizes RBS comment patterns
without parsing the type syntax itself. This keeps the grammar simple
while providing the foundation for tools to identify and process type
annotations separately.
RBS comments are now distinguished from regular comments in the AST,
allowing editors to provide enhanced type information display and
navigation for Ruby code with inline type signatures.1 parent 89bd7a8 commit 3ce9025
File tree
6 files changed
+64205
-48119
lines changed- queries
- src
- test/corpus
6 files changed
+64205
-48119
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
| |||
1068 | 1070 | | |
1069 | 1071 | | |
1070 | 1072 | | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
1071 | 1084 | | |
1072 | 1085 | | |
1073 | 1086 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
131 | 135 | | |
132 | 136 | | |
133 | 137 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments