Skip to content

Commit

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

class_annotation: $ => seq(
Expand Down Expand Up @@ -155,6 +156,15 @@ module.exports = grammar({

see_reference: $ => seq('@see', $.type, optional($.comment)),

link_reference: $ => seq(
alias(token(prec(-1, /[^\r\n{]+/)), $.comment),
'{',
'@link',
$.type,
'}',
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 @@ -292,3 +292,17 @@ Test Class Types
(identifier))
(identifier))
(comment)))

=========================
Test a Link Reference
=========================

is of type {@link CodeAction} or a Thenable that resolves to such.

---

(documentation
(link_reference
(comment)
(identifier)
(comment)))

0 comments on commit 87be810

Please sign in to comment.