Skip to content

Commit

Permalink
feat: support since annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Jan 22, 2024
1 parent 87be810 commit 0bf534f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
11 changes: 11 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ module.exports = grammar({
$.language_injection,
$.see_reference,
$.link_reference,
$.since_annotation,
),

class_annotation: $ => seq(
Expand Down Expand Up @@ -165,6 +166,16 @@ module.exports = grammar({
optional($.comment),
),

since_annotation: $ => seq(
'@since',
field('major', $.number),
'.',
field('minor', $.number),
'.',
field('patch', $.number),
optional($.comment),
),

qualifier: _ => choice('public', 'protected', 'private', 'package'),

class_at_comment: $ => seq(
Expand Down
14 changes: 14 additions & 0 deletions test/corpus/annotations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -306,3 +306,17 @@ is of type {@link CodeAction} or a Thenable that resolves to such.
(comment)
(identifier)
(comment)))

=========================
Test a Since Annotation
=========================

@since 3.17.0

---

(documentation
(since_annotation
major: (number)
minor: (number)
patch: (number)))

0 comments on commit 0bf534f

Please sign in to comment.