Skip to content

Commit 0aa448d

Browse files
committed
Apply revisions requested in review
1 parent 7274c6c commit 0aa448d

File tree

2 files changed

+88
-69
lines changed

2 files changed

+88
-69
lines changed

grammars/jsdoc.cson

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@
4141
'3':
4242
'name': 'entity.name.type.instance.jsdoc'
4343
'4':
44-
'name': 'punctuation.definition.begin.jsdoc'
44+
'name': 'punctuation.definition.bracket.angle.begin.jsdoc'
4545
'5':
4646
'name': 'constant.other.email.link.underline.jsdoc'
4747
'6':
48-
'name': 'punctuation.definition.end.jsdoc'
48+
'name': 'punctuation.definition.bracket.angle.end.jsdoc'
4949
}
5050
{
5151
# @borrows <that namepath> as <this namepath>
5252
'match': '''(?x)
5353
((@)borrows) \\s+
54-
((?:[^@\\s*/]|\\*[^/])++) # <that namepath>
55-
\\s++ (as) \\s++ # as
56-
((?:[^@\\s*/]|\\*[^/])++) # <this namepath>
54+
((?:[^@\\s*/]|\\*[^/])+) # <that namepath>
55+
\\s++ (as) \\s+ # as
56+
((?:[^@\\s*/]|\\*[^/])+) # <this namepath>
5757
'''
5858
'captures':
5959
'1':
@@ -150,13 +150,13 @@
150150
# URL
151151
(
152152
(?=https?://)
153-
(?:[^\\s*]|\\*[/])+
153+
(?:[^\\s*]|\\*[^/])+
154154
)
155155
|
156156
# JSDoc namepath
157157
(
158158
(?!https?://)
159-
(?:[^@\\s*/]|\\*[^/])++
159+
(?:[^@\\s*/]|\\*[^/])+
160160
)
161161
)
162162
'''
@@ -170,6 +170,12 @@
170170
'name': 'punctuation.definition.block.tag.jsdoc'
171171
'3':
172172
'name': 'variable.other.jsdoc'
173+
'patterns': [
174+
{
175+
'match': ','
176+
'name': 'punctuation.delimiter.object.comma.jsdoc'
177+
}
178+
]
173179
'match': '''(?x)
174180
((@)template)
175181
\\s+
@@ -232,8 +238,10 @@
232238
# - @<tag> {type} identifier
233239
'begin': '((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\\s+(?={)'
234240
'beginCaptures':
235-
'1': 'name': 'storage.type.class.jsdoc'
236-
'2': 'name': 'punctuation.definition.block.tag.jsdoc'
241+
'1':
242+
'name': 'storage.type.class.jsdoc'
243+
'2':
244+
'name': 'punctuation.definition.block.tag.jsdoc'
237245
'end': '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])'
238246
'patterns': [
239247
{
@@ -302,19 +310,23 @@
302310
{
303311
# Tags followed by a quoted arbitrary value
304312
# - @<tag> "Quoted value"
305-
'begin': '((@)(?:default(?:value)?|license|version))\\s+([\'"])'
313+
'begin': '((@)(?:default(?:value)?|license|version))\\s+(([\'"]))'
306314
'beginCaptures':
307315
'1':
308316
'name': 'storage.type.class.jsdoc'
309317
'2':
310318
'name': 'punctuation.definition.block.tag.jsdoc'
311319
'3':
312320
'name': 'variable.other.jsdoc'
321+
'4':
322+
'name': 'punctuation.definition.string.begin.jsdoc'
313323
'contentName': 'variable.other.jsdoc'
314-
'end': '\\3|(?=$|\\*/)'
324+
'end': '(\\3)|(?=$|\\*/)'
315325
'endCaptures':
316326
'0':
317327
'name': 'variable.other.jsdoc'
328+
'1':
329+
'name': 'punctuation.definition.string.end.jsdoc'
318330
}
319331
{
320332
# Tags followed by an arbitrary value
@@ -366,17 +378,19 @@
366378
'name': 'constant.other.description.jsdoc'
367379
}
368380
{
369-
# {@link|tutorial …}
370-
'begin': '({@)(?:link|linkcode|linkplain|tutorial)\\s*'
381+
# {@link|@tutorial …}
382+
'begin': '({)((@)(?:link(?:code|plain)?|tutorial))\\s*'
371383
'beginCaptures':
372-
'0':
373-
'name': 'storage.type.class.jsdoc'
374384
'1':
375-
'name': 'punctuation.definition.inline.tag.begin.jsdoc'
385+
'name': 'punctuation.definition.bracket.curly.begin.jsdoc'
386+
'2':
387+
'name': 'storage.type.class.jsdoc'
388+
'3':
389+
'name': 'punctuation.definition.inline.tag.jsdoc'
376390
'end': '}|(?=\\*/)'
377391
'endCaptures':
378392
'0':
379-
'name': 'punctuation.definition.inline.tag.end.jsdoc'
393+
'name': 'punctuation.definition.bracket.curly.end.jsdoc'
380394
'name': 'entity.name.type.instance.jsdoc'
381395
'patterns': [
382396
{
@@ -400,7 +414,6 @@
400414
]
401415

402416
'repository':
403-
404417
# Balanced brackets (square or curly)
405418
'brackets':
406419
'patterns': [
@@ -423,7 +436,6 @@
423436
]
424437
}
425438
]
426-
427439
# Balanced quotes
428440
'quotes':
429441
'patterns': [
@@ -446,7 +458,6 @@
446458
]
447459
}
448460
]
449-
450461
# {type}
451462
'type':
452463
'patterns': [

0 commit comments

Comments
 (0)