diff --git a/grammar.js b/grammar.js index d0954bc..83d248d 100644 --- a/grammar.js +++ b/grammar.js @@ -45,6 +45,7 @@ module.exports = grammar({ $.language_injection, $.see_reference, $.link_reference, + $.since_annotation, ), class_annotation: $ => seq( @@ -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( diff --git a/test/corpus/annotations.txt b/test/corpus/annotations.txt index fbe82ac..c9cea07 100644 --- a/test/corpus/annotations.txt +++ b/test/corpus/annotations.txt @@ -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)))