Skip to content

Commit

Permalink
Add @phpstan- prefix for PHPDoc tags, @template, @template-covariant,…
Browse files Browse the repository at this point in the history
… @template-contravariant, @extends, @implements, @use, @readonly, @immutable. Add additional tests for existing code.
  • Loading branch information
BladeMF committed Nov 2, 2023
1 parent 5e8f000 commit 803a37c
Show file tree
Hide file tree
Showing 2 changed files with 278 additions and 5 deletions.
11 changes: 7 additions & 4 deletions grammars/php.cson
Original file line number Diff line number Diff line change
Expand Up @@ -2685,7 +2685,9 @@
{
# Tags followed by a type expression
# - @<tag> type
'begin': '(@(?:global|param|property(-(read|write))?|return|throws|var))\\s+(?=[?A-Za-z_\\x{7f}-\\x{10ffff}\\\\]|\\()'
'begin': '(?x)(@(?:(phpstan-)?(
global|extends|implements|param|property(-(read|write))?|template|return|throws|var|use
)))\\s+(?=[?A-Za-z_\\x{7f}-\\x{10ffff}\\\\]|\\()'
'beginCaptures':
'1':
'name': 'keyword.other.phpdoc.php'
Expand All @@ -2706,10 +2708,11 @@
{
'match': '''(?x)
@
(
(phpstan-)?(
api|abstract|author|category|copyright|example|global|inherit[Dd]oc|internal|
license|link|method|property(-(read|write))?|package|param|return|see|since|source|
static|subpackage|throws|todo|var|version|uses|deprecated|final|ignore
immutable|license|link|method|property(-(read|write))?|package|param|readonly|
return|see|since|source|static|subpackage|template(-(covariant|contravariant))?|
throws|todo|var|version|use|deprecated|final|ignore
)\\b
'''
'name': 'keyword.other.phpdoc.php'
Expand Down
Loading

0 comments on commit 803a37c

Please sign in to comment.