@@ -72,7 +72,7 @@ export default class DocElementParser {
7272 break ;
7373 }
7474
75- if ( token . type === TokenType . Tag ) {
75+ if ( token . type === TokenType . BlockTag ) {
7676 switch ( token . tag ) {
7777 case '@see' :
7878 tokenizer . getToken ( ) ;
@@ -85,12 +85,13 @@ export default class DocElementParser {
8585 parsing = false ; // end of summary tokens
8686 break ;
8787 }
88- } else if ( token . type === TokenType . Inline ) {
88+ } else if ( token . type === TokenType . InlineTag ) {
8989 switch ( token . tag ) {
9090 case '@inheritdoc' :
9191 tokenizer . getToken ( ) ;
9292 if ( docElements . length > 0 || documentation . summary . length > 0 ) {
93- documentation . reportError ( 'Cannot provide summary in AEDoc if @inheritdoc tag is given' ) ;
93+ documentation . reportError ( 'A summary block is not allowed here,'
94+ + ' because the @inheritdoc target provides the summary' ) ;
9495 }
9596 documentation . incompleteInheritdocs . push ( token ) ;
9697 documentation . isDocInherited = true ;
@@ -114,7 +115,7 @@ export default class DocElementParser {
114115 docElements . push ( { kind : 'textDocElement' , value : token . text } as ITextElement ) ;
115116 tokenizer . getToken ( ) ;
116117 } else {
117- documentation . reportError ( `Unidentifiable Token ${ token . type } ${ token . tag } ${ token . text } ` ) ;
118+ documentation . reportError ( `Unidentifiable Token ${ token . type } ${ token . tag } " ${ token . text } " ` ) ;
118119 }
119120 }
120121 return docElements ;
@@ -125,7 +126,7 @@ export default class DocElementParser {
125126 * linkDocElement with the corresponding information. If the corresponding inline tag \@link is
126127 * not formatted correctly an error will be reported.
127128 *
128- * The format for the \@link tag is {\@link url or API defintion reference | display text}, where
129+ * The format for the \@link tag is {\@link URL or API defintion reference | display text}, where
129130 * the '|' is only needed if the optional display text is given.
130131 *
131132 * Examples:
@@ -136,7 +137,7 @@ export default class DocElementParser {
136137 */
137138 public static parseLinkTag ( documentation : ApiDocumentation , tokenItem : Token ) : IHrefLinkElement | ICodeLinkElement {
138139 if ( ! tokenItem . text ) {
139- documentation . reportError ( 'Invalid @link inline token, a url or API definition reference must be given ' ) ;
140+ documentation . reportError ( 'The { @link} tag must include a URL or API item reference' ) ;
140141 return ;
141142 }
142143
@@ -148,7 +149,7 @@ export default class DocElementParser {
148149 }
149150 } ) ;
150151 if ( pipeSplitContent . length > 2 ) {
151- documentation . reportError ( 'Invalid @link parameters, at most one pipe character allowed. ' ) ;
152+ documentation . reportError ( 'The { @link} tag contains more than one pipe character ("|") ' ) ;
152153 return ;
153154 }
154155
@@ -157,9 +158,10 @@ export default class DocElementParser {
157158 if ( tokenItem . text . match ( this . _hrefRegEx ) ) {
158159 const urlContent : string [ ] = pipeSplitContent [ 0 ] . split ( ' ' ) ;
159160
160- // Make sure only a single url is given
161+ // Make sure only a single URL is given
161162 if ( urlContent . length > 1 && urlContent [ 1 ] !== '' ) {
162- documentation . reportError ( 'Invalid @link parameter, url must be a single string.' ) ;
163+ documentation . reportError ( 'The {@link} tag contains additional spaces after the URL;'
164+ + ' if the URL contains spaces, encode them using %20; for display text, use a pipe delimiter ("|")' ) ;
163165 return ;
164166 }
165167
@@ -195,7 +197,8 @@ export default class DocElementParser {
195197 if ( linkDocElement && pipeSplitContent . length > 1 ) {
196198 const displayTextParts : string [ ] = pipeSplitContent [ 1 ] . match ( this . _wordRegEx ) ;
197199 if ( displayTextParts && displayTextParts [ 0 ] . length !== pipeSplitContent [ 1 ] . length ) {
198- documentation . reportError ( 'Display name in @link token may only contain alphabetic characters.' ) ;
200+ documentation . reportError ( `The {@link} tag\'s display text contains unsupported `
201+ + ` symbols: "${ pipeSplitContent [ 1 ] } "` ) ;
199202 return ;
200203 }
201204 // Full match is valid text
@@ -218,8 +221,8 @@ export default class DocElementParser {
218221 // Check to make sure the API definition reference is at most one string
219222 const tokenChunks : string [ ] = token . text . split ( ' ' ) ;
220223 if ( tokenChunks . length > 1 ) {
221- documentation . reportError ( 'Too many parameters for @inheritdoc inline tag. ' +
222- 'The format should be {@inheritdoc scopeName/packageName:exportName}. Extra parameters are ignored ' ) ;
224+ documentation . reportError ( 'The {@inheritdoc} tag does not match the expected pattern ' +
225+ ' " {@inheritdoc @ scopeName/packageName:exportName}" ' ) ;
223226 return ;
224227 }
225228
@@ -231,7 +234,7 @@ export default class DocElementParser {
231234 ) ;
232235 // if API reference expression is formatted incorrectly then apiDefinitionRef will be undefined
233236 if ( ! apiDefinitionRef ) {
234- documentation . reportError ( 'Incorrecty formatted API definition reference' ) ;
237+ documentation . reportError ( `Incorrectly formatted API item reference: " ${ token . text } "` ) ;
235238 return ;
236239 }
237240
0 commit comments