|
1 | 1 | " Vim syntax file |
2 | 2 | " Language: JavaScript |
3 | 3 | " Maintainer: Yi Zhao (ZHAOYI) <zzlinux AT hotmail DOT com> |
4 | | -" Last Change By: Darrick Wiebe |
5 | | -" Last Change: August 25, 2010 |
6 | | -" Version: 0.7.8 |
7 | | -" Changes: Disambiguate regex strings and mathematical statements |
| 4 | +" Last Change By: Marc Harter |
| 5 | +" Last Change: February 18, 2011 |
| 6 | +" Version: 0.7.9 |
| 7 | +" Changes: Updates JSDoc syntax |
8 | 8 | " |
9 | 9 | " TODO: |
10 | 10 | " - Add the HTML syntax inside the JSDoc |
@@ -36,19 +36,31 @@ syntax region javaScriptLineComment start=+^\s*\/\/+ skip=+\n\s*\/\/+ end=+$ |
36 | 36 | syntax region javaScriptCvsTag start="\$\cid:" end="\$" oneline contained |
37 | 37 | syntax region javaScriptComment start="/\*" end="\*/" contains=javaScriptCommentTodo,javaScriptCvsTag,@Spell fold |
38 | 38 |
|
39 | | -"" JSDoc support start |
| 39 | +"" JSDoc / JSDoc Toolkit |
40 | 40 | if !exists("javascript_ignore_javaScriptdoc") |
41 | 41 | syntax case ignore |
42 | 42 |
|
43 | 43 | "" syntax coloring for javadoc comments (HTML) |
44 | 44 | "syntax include @javaHtml <sfile>:p:h/html.vim |
45 | 45 | "unlet b:current_syntax |
46 | 46 |
|
47 | | - syntax region javaScriptDocComment matchgroup=javaScriptComment start="/\*\*\s*$" end="\*/" contains=javaScriptDocTags,javaScriptCommentTodo,javaScriptCvsTag,@javaScriptHtml,@Spell fold |
48 | | - syntax match javaScriptDocTags contained "@\(param\|argument\|requires\|exception\|throws\|type\|class\|extends\|see\|link\|member\|module\|method\|title\|namespace\|optional\|default\|base\|file\)\>" nextgroup=javaScriptDocParam,javaScriptDocSeeTag skipwhite |
49 | | - syntax match javaScriptDocTags contained "@\(beta\|deprecated\|description\|fileoverview\|author\|license\|version\|returns\=\|constructor\|private\|protected\|final\|ignore\|addon\|exec\)\>" |
50 | | - syntax match javaScriptDocParam contained "\%(#\|\w\|\.\|:\|\/\)\+" |
51 | | - syntax region javaScriptDocSeeTag contained matchgroup=javaScriptDocSeeTag start="{" end="}" contains=javaScriptDocTags |
| 47 | + syntax region javaScriptDocComment matchgroup=javaScriptComment start="/\*\*\s*" end="\*/" contains=javaScriptDocTags,javaScriptCommentTodo,javaScriptCvsTag,@javaScriptHtml,@Spell fold |
| 48 | + |
| 49 | + " tags containing a param |
| 50 | + syntax match javaScriptDocTags contained "@\(augments\|base\|borrows\|class\|constructs\|default\|exception\|exports\|extends\|file\|member\|memberOf\|module\|name\|namespace\|optional\|requires\|title\|throws\|version\)\>" nextgroup=javaScriptDocParam skipwhite |
| 51 | + " tags containing type and param |
| 52 | + syntax match javaScriptDocTags contained "@\(argument\|param\|property\)\>" nextgroup=javaScriptDocType skipwhite |
| 53 | + " tags containing type but no param |
| 54 | + syntax match javaScriptDocTags contained "@\(type\|return\|returns\)\>" nextgroup=javaScriptDocTypeNoParam skipwhite |
| 55 | + " tags containing references |
| 56 | + syntax match javaScriptDocTags contained "@\(lends\|link\|see\)\>" nextgroup=javaScriptDocSeeTag skipwhite |
| 57 | + " other tags (no extra syntax) |
| 58 | + syntax match javaScriptDocTags contained "@\(access\|addon\|alias\|author\|beta\|constant\|constructor\|copyright\|deprecated\|description\|event\|example\|exec\|field\|fileOverview\|fileoverview\|function\|global\|ignore\|inner\|license\|overview\|private\|protected\|project\|public\|readonly\|since\|static\)\>" |
| 59 | + |
| 60 | + syntax match javaScriptDocType contained "\%(#\|\"\|{\|}\|\w\|\.\|:\|\/\)\+" nextgroup=javaScriptDocParam skipwhite |
| 61 | + syntax match javaScriptDocTypeNoParam contained "\%(#\|\"\|{\|}\|\w\|\.\|:\|\/\)\+" |
| 62 | + syntax match javaScriptDocParam contained "\%(#\|\"\|{\|}\|\w\|\.\|:\|\/\)\+" |
| 63 | + syntax region javaScriptDocSeeTag contained matchgroup=javaScriptDocSeeTag start="{" end="}" contains=javaScriptDocTags |
52 | 64 |
|
53 | 65 | syntax case match |
54 | 66 | endif "" JSDoc end |
@@ -191,7 +203,9 @@ if version >= 508 || !exists("did_javascript_syn_inits") |
191 | 203 | HiLink javaScriptCvsTag Function |
192 | 204 | HiLink javaScriptDocTags Special |
193 | 205 | HiLink javaScriptDocSeeTag Function |
194 | | - HiLink javaScriptDocParam Function |
| 206 | + HiLink javaScriptDocType Type |
| 207 | + HiLink javaScriptDocTypeNoParam Type |
| 208 | + HiLink javaScriptDocParam Label |
195 | 209 | HiLink javaScriptStringS String |
196 | 210 | HiLink javaScriptStringD String |
197 | 211 | HiLink javaScriptRegexpString String |
|
0 commit comments