%YAML 1.2 --- # http://www.sublimetext.com/docs/3/syntax.html name: Javadoc file_extensions: [] scope: text.html.javadoc hidden: true variables: id: '(?:[\p{L}_$][\p{L}\p{N}_$]*)' javadoc_block_tag_terminator: (?=^\s*\*?\s*@) contexts: prototype: # https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#leadingasterisks - match: ^\s*(\*)\s*(?!\s*@) captures: 1: punctuation.definition.comment.javadoc main: - meta_include_prototype: false - match: /\*\* scope: comment.block.documentation.javadoc punctuation.definition.comment.begin.javadoc embed: contents embed_scope: comment.block.documentation.javadoc text.html.javadoc escape: \*/ escape_captures: 0: comment.block.documentation.javadoc punctuation.definition.comment.end.javadoc contents: - meta_include_prototype: false # Block tag in the first line (immediately after '/**'). - match: \s*(?=@) embed: javadoc-block-tags escape: '{{javadoc_block_tag_terminator}}' # We rely on 'escape' to pop the inner context out. # 'set' unfortunately will mess up the meta scopes. - match: '' push: - match: ^\s*(\*)?\s*(?=@) captures: 1: punctuation.definition.comment.javadoc embed: javadoc-block-tags escape: '{{javadoc_block_tag_terminator}}' - include: inline-formatting inline-formatting: - include: javadoc-inline-tags - include: scope:text.html.basic javadoc-block-tag-base: - meta_scope: meta.block-tag.javadoc - include: inline-formatting javadoc-block-tags: # https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#param - match: (@)param\b scope: keyword.other.documentation.param.javadoc captures: 1: punctuation.definition.keyword.javadoc push: [javadoc-block-tag-base, param-tag-parameter] # https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#see - match: (@)see\b scope: keyword.other.documentation.see.javadoc captures: 1: punctuation.definition.keyword.javadoc push: [javadoc-block-tag-base, see-tag-content] # https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#throws - match: (@)(throws|exception)\b scope: keyword.other.documentation.throws.javadoc captures: 1: punctuation.definition.keyword.javadoc push: [javadoc-block-tag-base, reference] - match: (@)(uses|provides)\b scope: keyword.other.documentation.uses-or-provides.javadoc captures: 1: punctuation.definition.keyword.javadoc push: [javadoc-block-tag-base, reference] - match: (@)(return|deprecated|author|version|since|apiNote|impl(?:Note|Spec)|moduleGraph|serial(?:Field|Data)?)\b scope: keyword.other.documentation.javadoc captures: 1: punctuation.definition.keyword.javadoc push: javadoc-block-tag-base - match: '@' pop: true param-tag-parameter: - match: \S+ scope: variable.parameter.javadoc pop: true see-tag-content: - match: (?=['<]) pop: true - match: (?=\S) set: reference reference: - match: (?:{{id}}\.)*{{id}}(?:#{{id}})?|#{{id}} scope: markup.underline.link.javadoc set: - match: \( scope: markup.underline.link.javadoc set: - match: \) scope: markup.underline.link.javadoc pop: true - match: . scope: markup.underline.link.javadoc - match: '' pop: true javadoc-inline-tag-terminator: - match: \} scope: punctuation.section.inline-tag.end.javadoc pop: true javadoc-inline-tag-base: - meta_scope: meta.inline-tag.javadoc - include: javadoc-inline-tag-terminator # Multi-line tags mustn't highlight leading asterisk. javadoc-inline-tags: # https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#code # https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#literal - match: ({)((@)(?:code|literal))(?:\s+|(?=\})) captures: 1: punctuation.section.inline-tag.begin.javadoc 2: keyword.other.documentation.code-or-literal.javadoc 3: punctuation.definition.keyword.javadoc push: - meta_scope: meta.inline-tag.javadoc - include: javadoc-inline-tag-terminator - include: code-tag-bracket-balancing - match: ^\s+ - match: . scope: markup.raw.javadoc # https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#link - match: ({)((@)link(?:plain)?)\b captures: 1: punctuation.section.inline-tag.begin.javadoc 2: keyword.other.documentation.link.javadoc 3: punctuation.definition.keyword.javadoc push: [javadoc-inline-tag-base, link-tag-label, reference-in-inline-tag] # https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#value - match: ({)((@)value)\b captures: 1: punctuation.section.inline-tag.begin.javadoc 2: keyword.other.documentation.value.javadoc 3: punctuation.definition.keyword.javadoc push: [javadoc-inline-tag-base, reference-in-inline-tag] # http://openjdk.java.net/jeps/225 # https://bugs.openjdk.java.net/browse/JDK-8178725 - match: ({)((@)(?:index|extLink))\b captures: 1: punctuation.section.inline-tag.begin.javadoc 2: keyword.other.documentation.javadoc 3: punctuation.definition.keyword.javadoc push: javadoc-inline-tag-base # https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#inheritDoc - match: ({)((@)inheritDoc)(}) scope: meta.inline-tag.javadoc captures: 1: punctuation.section.inline-tag.begin.javadoc 2: keyword.other.documentation.javadoc 3: punctuation.definition.keyword.javadoc 4: punctuation.section.inline-tag.end.javadoc code-tag-bracket-balancing: - match: \{ scope: markup.raw.javadoc push: - match: \} scope: markup.raw.javadoc pop: true - include: code-tag-bracket-balancing - match: . scope: markup.raw.javadoc link-tag-label: - match: \s* set: - meta_content_scope: meta.label.javadoc - include: scope:text.html.basic - match: (?=\}) pop: true reference-in-inline-tag: - match: '' set: reference with_prototype: - match: (?=\}) pop: true